[FIX]sale_crm: when validating a SO with a sale team associated, information was not in associated invoice.

bzr revid: csn@openerp.com-20130516151255-azu6a3x6les0tzu6
This commit is contained in:
Cedric Snauwaert 2013-05-16 17:12:55 +02:00
parent 54ef169ce3
commit 655e36bc50
1 changed files with 6 additions and 0 deletions

View File

@ -29,6 +29,12 @@ class sale_order(osv.osv):
domain="['|',('section_id','=',section_id),('section_id','=',False), ('object_id.model', '=', 'crm.lead')]")
}
def _prepare_invoice(self, cr, uid, order, lines, context=None):
invoice_vals = super(sale_order, self)._prepare_invoice(cr, uid, order, lines, context=context)
if order.section_id and order.section_id.id:
invoice_vals['section_id'] = order.section_id.id
return invoice_vals
class res_users(osv.Model):
_inherit = 'res.users'