From: Denis Ledoux Date: Wed, 26 Nov 2014 11:35:36 +0000 (+0100) Subject: [MERGE] forward port of branch 7.0 up to e2dd18f X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;h=02f4f9a57236718df7bc0af86637eecea7842c48;p=odoo%2Fodoo.git [MERGE] forward port of branch 7.0 up to e2dd18f --- 02f4f9a57236718df7bc0af86637eecea7842c48 diff --cc addons/account/account_invoice.py index 70d644d,f90c966..284dba8 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@@ -1827,12 -1800,18 +1827,12 @@@ class res_partner(osv.osv) ''' Find the partner for which the accounting entries will be created ''' - # FIXME: after 7.0, to replace by function field partner.commercial_partner_id - - #if the chosen partner is not a company and has a parent company, use the parent for the journal entries - #because you want to invoice 'Agrolait, accounting department' but the journal items are for 'Agrolait' - while not partner.is_company and partner.parent_id: - partner = partner.parent_id - return partner + return partner.commercial_partner_id - def copy(self, cr, uid, id, default=None, context=None): + def copy_data(self, cr, uid, id, default=None, context=None): default = default or {} default.update({'invoice_ids' : []}) - return super(res_partner, self).copy(cr, uid, id, default, context) + return super(res_partner, self).copy_data(cr, uid, id, default=default, context=context) class mail_compose_message(osv.Model):