main #7

Merged
admin merged 620 commits from main into dev 2026-03-29 13:03:25 +00:00
2 changed files with 19 additions and 1 deletions
Showing only changes of commit 4f6641ceeb - Show all commits

View File

@@ -136,3 +136,20 @@ class Product(ModelSQL,ModelView):
__name__ = 'price.product' __name__ = 'price.product'
price = fields.Many2One('price.price',"Price index") price = fields.Many2One('price.price',"Price index")
product = fields.Many2One('product.product',"Product") 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> <tree>
<field name="price"/> <field name="price"/>
<field name="product"/> <field name="product"/>
<field name="attribute"/>
</tree> </tree>