This commit is contained in:
2026-03-05 19:25:17 +01:00
parent 915fd17d83
commit 13000f110d
2 changed files with 23 additions and 8 deletions

View File

@@ -501,16 +501,28 @@ class Line(metaclass=PoolMeta):
fields.Many2One('product.attribute.set', "Attribute Set"),
'on_change_with_attribute_set'
)
attributes_name = fields.Function(
fields.Char("Attributes Name"),
'on_change_with_attributes_name'
)
att_desc = fields.Function(fields.Char("Attributes"),'get_attributes')
def get_attributes(self, name):
if not self.attributes:
return ''
parts = []
for attribute, value in self.attributes.items():
parts.append(f"{attribute.name}: {value}")
return ', '.join(parts)
@fields.depends('product')
def on_change_with_attribute_set(self, name=None):
if self.product and self.product.template:
return self.product.template.attribute_set.id
attributes_name = fields.Function(
fields.Char("Attributes Name"),
'on_change_with_attributes_name'
)
@fields.depends('product', 'attributes')
def on_change_with_attributes_name(self, name=None):