summaryrefslogtreecommitdiff
path: root/addons/website_sale/models
diff options
context:
space:
mode:
authorAndrea Grazioso (agr-odoo) <agr@odoo.com>2020-05-04 15:49:28 +0000
committerAndrea Grazioso (agr-odoo) <agr@odoo.com>2020-05-11 13:11:56 +0000
commit889b525178a3f9b1855553c10c78e3c1b40c6efd (patch)
treee7e2e691f8c500f0ae0957b340c47712c2e68996 /addons/website_sale/models
parent73f56875ab013ca84d1cbc76ee73da1b34a3dc4a (diff)
[FIX] website_sale: prevent same sequence on duplicate
1) Have a [DEMO] product available on website. 2) Duplicate [DEMO] into several products. 3) Open the website ecommerce page 4) Go in edit mode 5) Click on one of the middle duplicates and go to Customize -> Promote -> Push up Item will not raise by one position but will be shifted randomly because when duplicating the sequence number is copies so it will be the same and this wil not work with the current resequencing algorithm which just swap the sequence number to invert the positions. Forcing copy=False on the attribute solve the issue opw-2227976 closes odoo/odoo#50603 closes odoo/odoo#51039 X-original-commit: 2a3704ac56d1625d8b35df80202473ffee03beb2 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/website_sale/models')
-rw-r--r--addons/website_sale/models/product.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/website_sale/models/product.py b/addons/website_sale/models/product.py
index 2976b8195ee..effe4749833 100644
--- a/addons/website_sale/models/product.py
+++ b/addons/website_sale/models/product.py
@@ -188,7 +188,7 @@ class ProductTemplate(models.Model):
website_size_y = fields.Integer('Size Y', default=1)
website_style_ids = fields.Many2many('product.style', string='Styles')
website_sequence = fields.Integer('Website Sequence', help="Determine the display order in the Website E-commerce",
- default=lambda self: self._default_website_sequence())
+ default=lambda self: self._default_website_sequence(), copy=False)
public_categ_ids = fields.Many2many(
'product.public.category', relation='product_public_category_product_template_rel',
string='Website Product Category',