From 499a649b162995ad2bf54f2bb1a50951653ed5ad Mon Sep 17 00:00:00 2001 From: "Nasreddin (bon)" Date: Fri, 26 Jun 2020 14:51:52 +0000 Subject: [PATCH] [FIX] sale: Duplicating a Sales Order with Custom Attributes Issue - Turn on Sales Product Configurator - Create a product template with an attribute and an attribute value defined as "is custom". - Create a new quote, add the template, and configure the product, entering a custom value. - Save. - Duplicate the Quote Custom value missing. Cause Custom value (field product_custom_attribute_value_ids) not duplicated. Solution Add attribute 'copy=True' to field product_custom_attribute_value_ids. opw-2279933 closes odoo/odoo#53827 X-original-commit: 0ca092361819bb198c87ca6772ec0e93a2158018 Signed-off-by: Nicolas Martinelli (nim) Signed-off-by: bon-odoo --- addons/sale/models/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index baca5d02acb..f471d60b898 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -1296,7 +1296,7 @@ class SaleOrderLine(models.Model): product_uom = fields.Many2one('uom.uom', string='Unit of Measure', domain="[('category_id', '=', product_uom_category_id)]") product_uom_category_id = fields.Many2one(related='product_id.uom_id.category_id', readonly=True) product_uom_readonly = fields.Boolean(compute='_compute_product_uom_readonly') - product_custom_attribute_value_ids = fields.One2many('product.attribute.custom.value', 'sale_order_line_id', string="Custom Values") + product_custom_attribute_value_ids = fields.One2many('product.attribute.custom.value', 'sale_order_line_id', string="Custom Values", copy=True) # M2M holding the values of product.attribute with create_variant field set to 'no_variant' # It allows keeping track of the extra_price associated to those attribute values and add them to the SO line description