[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:
Raphael Collet 2011-11-30 16:46:15 +01:00
commit 86a66f3d46
1 changed files with 1 additions and 1 deletions

View File

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