[MERGE] lp:894434 (product: wrong test for preventing the change of UoM category)
bzr revid: rco@openerp.com-20111130154615-3hqztlw2e3771rx3
This commit is contained in:
commit
86a66f3d46
|
@ -171,7 +171,7 @@ class product_uom(osv.osv):
|
|||
def write(self, cr, uid, ids, vals, context=None):
|
||||
if 'category_id' in vals:
|
||||
for uom in self.browse(cr, uid, ids, context=context):
|
||||
if uom.category_id != vals['category_id']:
|
||||
if uom.category_id.id != vals['category_id']:
|
||||
raise osv.except_osv(_('Warning'),_("Cannot change the category of existing UoM '%s'.") % (uom.name,))
|
||||
return super(product_uom, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
|
|
Loading…
Reference in New Issue