From 811466be2faef29b9a0f53f4ae5126a8a8134bba Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Fri, 17 Aug 2012 11:21:34 +0530 Subject: [PATCH] [IMP] account : Improved the onchange uos_id method. bzr revid: mdi@tinyerp.com-20120817055134-4p4gcsgusmyk34wd --- addons/account/account_invoice.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 225904f28b7..f0d2f2d8360 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1479,10 +1479,11 @@ class account_invoice_line(osv.osv): prod = self.pool.get('product.product').browse(cr, uid, product, context=context) prod_uom = self.pool.get('product.uom').browse(cr, uid, uom, context=context) if prod.uom_id.category_id.id != prod_uom.category_id.id: - warning = { + warning = { 'title': _('Warning!'), 'message': _('The selected unit of measure is not compatible with the unit of measure of the product.') - } + } + res['value'].update({'uos_id': prod.uom_id.id}) return {'value': res['value'], 'warning': warning} return res