From fa3016fd4e853242a3102203b541d9f44bff2f2d Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 4 Jul 2011 16:16:07 +0200 Subject: [PATCH] [fix] changed uos_id_change in account.invoice.line bzr revid: nicolas.vanhoren@openerp.com-20110704141607-dj6hkda8yv46pr8y --- addons/account/account_invoice_view.xml | 2 +- addons/account/invoice.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index cd1f41af3dc..be431c9b2e7 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -54,7 +54,7 @@ - + diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 712d000b02e..09e8304340c 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -1388,7 +1388,12 @@ class account_invoice_line(osv.osv): res_final['value']['price_unit'] = new_price return res_final - def uos_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 uos_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 = company_id if company_id != None else context.get('company_id',False) + context = dict(context) + context.update({'company_id': company_id}) warning = {} res = self.product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, currency_id, context=context) if 'uos_id' in res['value']: