[IMP] account : Improved the onchange uos_id method.

bzr revid: mdi@tinyerp.com-20120817055134-4p4gcsgusmyk34wd
This commit is contained in:
Divyesh Makwana (Open ERP) 2012-08-17 11:21:34 +05:30
parent 63b69f217e
commit 811466be2f
1 changed files with 3 additions and 2 deletions

View File

@ -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