[FIX] product: _check_valid_attribute

All the ids must be checked.
Introduced by 856b31719c
This commit is contained in:
Goffin Simon
2016-03-07 13:03:36 +01:00
parent a37bd77895
commit 9519ad42ea
+4 -2
View File
@@ -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'])