From 62a8e81f28c034d481e9a008148c021adc8791c0 Mon Sep 17 00:00:00 2001 From: nikj-odoo Date: Thu, 10 Aug 2023 12:38:57 +0530 Subject: [PATCH] [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) --- addons/product/models/product_template_attribute_line.py | 3 ++- addons/product/views/product_template_views.xml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/product/models/product_template_attribute_line.py b/addons/product/models/product_template_attribute_line.py index 9cc23fb1ad1..10143cca7f7 100644 --- a/addons/product/models/product_template_attribute_line.py +++ b/addons/product/models/product_template_attribute_line.py @@ -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", diff --git a/addons/product/views/product_template_views.xml b/addons/product/views/product_template_views.xml index 578c48919d7..f154b45449e 100644 --- a/addons/product/views/product_template_views.xml +++ b/addons/product/views/product_template_views.xml @@ -61,6 +61,7 @@ +