~camptocamp/account-invoicing/correct_payment_term_balance_mdh

« back to all changes in this revision

Viewing changes to account_invoice_shipping_address/sale.py

[MRG] add account_invoice_shipping_address

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- encoding: utf-8 -*-
 
2
##############################################################################
 
3
#
 
4
#    OpenERP, Open Source Management Solution
 
5
#    Copyright (C) 2011 Domsense s.r.l. (<http://www.domsense.com>).
 
6
#    Copyright (C) 2013 Andrea Cometa Perito Informatico (www.andreacometa.it)
 
7
#
 
8
#    This program is free software: you can redistribute it and/or modify
 
9
#    it under the terms of the GNU Affero General Public License as
 
10
#    published by the Free Software Foundation, either version 3 of the
 
11
#    License, or (at your option) any later version.
 
12
#
 
13
#    This program is distributed in the hope that it will be useful,
 
14
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
#    GNU Affero General Public License for more details.
 
17
#
 
18
#    You should have received a copy of the GNU Affero General Public License
 
19
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
20
#
 
21
##############################################################################
 
22
 
 
23
from openerp.osv import orm
 
24
 
 
25
 
 
26
class sale_order(orm.Model):
 
27
    _inherit = 'sale.order'
 
28
 
 
29
    def _prepare_invoice(self, cr, uid, order, lines, context=None):
 
30
 
 
31
        res = super(sale_order, self)._prepare_invoice(
 
32
            cr, uid, order, lines, context=context
 
33
        )
 
34
        res.update({
 
35
            'address_shipping_id': order.partner_shipping_id.id, })
 
36
        return res