[IMP] product: reorder product attribute

Currently the user cannot modify the order as he adds new attribute to the product.
In this commit he will be able to do that

task-3451377

closes odoo/odoo#131514

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
nikj-odoo
2023-09-07 14:45:19 +00:00
committed by Victor Feyens
parent 52a1f267b7
commit 62a8e81f28
2 changed files with 3 additions and 1 deletions
@@ -13,7 +13,7 @@ class ProductTemplateAttributeLine(models.Model):
_rec_name = 'attribute_id'
_rec_names_search = ['attribute_id', 'value_ids']
_description = "Product Template Attribute Line"
_order = 'attribute_id, id'
_order = 'sequence, attribute_id, id'
active = fields.Boolean(default=True)
product_tmpl_id = fields.Many2one(
@@ -22,6 +22,7 @@ class ProductTemplateAttributeLine(models.Model):
ondelete='cascade',
required=True,
index=True)
sequence = fields.Integer("Sequence", default=10)
attribute_id = fields.Many2one(
comodel_name='product.attribute',
string="Attribute",
@@ -61,6 +61,7 @@
<field name="attribute_line_ids" widget="one2many" context="{'show_attribute': False}">
<tree string="Variants" editable="bottom" decoration-info="value_count &lt;= 1">
<field name="value_count" column_invisible="True"/>
<field name="sequence" widget="handle"/>
<field name="attribute_id" readonly="id"/>
<field name="value_ids" widget="many2many_tags" options="{'no_create_edit': True, 'color_field': 'color'}" context="{'default_attribute_id': attribute_id, 'show_attribute': False}"/>
<button string="Configure" class="float-end btn-secondary"