From 9519ad42ea7594ee638e97f396ad65a02095db9b Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 7 Mar 2016 10:24:19 +0100 Subject: [PATCH] [FIX] product: _check_valid_attribute All the ids must be checked. Introduced by 856b31719c69e7f022143ce39df7c6c43688beb9 --- addons/product/product.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index e88639db877..97dc6b778fe 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -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'])