This commit is contained in:
2026-03-20 13:43:47 +01:00
parent cabd032bc6
commit 4f6641ceeb
2 changed files with 19 additions and 1 deletions

View File

@@ -136,3 +136,20 @@ class Product(ModelSQL,ModelView):
__name__ = 'price.product'
price = fields.Many2One('price.price',"Price index")
product = fields.Many2One('product.product',"Product")
attribute = fields.Many2One('product.attribute',"Attribute",domain=[
('sets', '=', Eval('attribute_set')),
],
states={
'readonly': ~Eval('attribute_set'),
},
depends=['product', 'attribute_set'])
attribute_set = fields.Function(
fields.Many2One('product.attribute.set', "Attribute Set"),
'on_change_with_attribute_set'
)
@fields.depends('product')
def on_change_with_attribute_set(self, name=None):
if self.product and self.product.template and self.product.template.attribute_set:
return self.product.template.attribute_set.id

View File

@@ -1,4 +1,5 @@
<tree>
<field name="price"/>
<field name="product"/>
<field name="attribute"/>
</tree>