From c8ebd30e8b61d7459d6c9a23fa4127dbb1038e78 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 4 Jul 2011 16:14:10 +0200 Subject: [PATCH] [fix] changed product_id_change in account.invoice.line bzr revid: nicolas.vanhoren@openerp.com-20110704141410-h7ecesw5aduo0kbd --- addons/account/account_invoice_view.xml | 4 ++-- addons/account/invoice.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index ed45c705674..cd1f41af3dc 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -53,7 +53,7 @@
- + @@ -175,7 +175,7 @@ - + diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 8b1b2a0edda..712d000b02e 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -1312,10 +1312,12 @@ class account_invoice_line(osv.osv): res['arch'] = etree.tostring(doc) return res - def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None): + def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None, company_id=None): if context is None: context = {} - company_id = context.get('company_id',False) + company_id = company_id if company_id != None else context.get('company_id',False) + context = dict(context) + context.update({'company_id': company_id}) if not partner_id: raise osv.except_osv(_('No Partner Defined !'),_("You must first select a partner !") ) if not product: