[FIX] product: _check_valid_attribute
To check if the values set for the attribute are valid. opw:653945
This commit is contained in:
parent
c054350dac
commit
856b31719c
|
@ -432,6 +432,14 @@ class product_attribute_line(osv.osv):
|
||||||
'value_ids': fields.many2many('product.attribute.value', id1='line_id', id2='val_id', string='Product Attribute Value'),
|
'value_ids': fields.many2many('product.attribute.value', id1='line_id', id2='val_id', string='Product Attribute Value'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
_constraints = [
|
||||||
|
(_check_valid_attribute, 'Error ! You cannot use this attribute with the following value.', ['attribute_id'])
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------
|
#----------------------------------------------------------
|
||||||
# Products
|
# Products
|
||||||
|
|
Loading…
Reference in New Issue