[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) <nim@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
This commit is contained in:
Nasreddin (bon)
2020-06-29 15:37:29 +00:00
parent 9b2c05742d
commit 499a649b16
+1 -1
View File
@@ -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