[FIX] product: _check_valid_attribute
All the ids must be checked.
Introduced by 856b31719c
This commit is contained in:
@@ -350,8 +350,10 @@ class product_attribute_line(osv.osv):
|
||||
}
|
||||
|
||||
def _check_valid_attribute(self, cr, uid, ids, context=None):
|
||||
obj_pal = self.browse(cr, uid, ids[0], context=context)
|
||||
return obj_pal.value_ids <= obj_pal.attribute_id.value_ids
|
||||
for obj_pal in self.browse(cr, uid, ids, context=context):
|
||||
if not (obj_pal.value_ids <= obj_pal.attribute_id.value_ids):
|
||||
return False
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
(_check_valid_attribute, 'Error ! You cannot use this attribute with the following value.', ['attribute_id'])
|
||||
|
||||
Reference in New Issue
Block a user