[MERGE] forward port of branch 7.0 up to e2dd18f
authorDenis Ledoux <dle@odoo.com>
Wed, 26 Nov 2014 11:35:36 +0000 (12:35 +0100)
committerDenis Ledoux <dle@odoo.com>
Wed, 26 Nov 2014 11:35:36 +0000 (12:35 +0100)
1  2 
addons/account/account_invoice.py
addons/marketing_campaign/__openerp__.py
addons/mrp/mrp.py
addons/product/product.py
addons/product/product_view.xml
addons/project_timesheet/project_timesheet.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):
Simple merge
Simple merge
Simple merge