From 9ab01c42bc0750a025666523f868f5c48269467d Mon Sep 17 00:00:00 2001 From: wilsongomez Date: Thu, 3 Mar 2022 11:33:36 -0500 Subject: [PATCH] minor fix --- product.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/product.py b/product.py index 3892bd5..4481138 100644 --- a/product.py +++ b/product.py @@ -73,4 +73,13 @@ class Product(metaclass=PoolMeta): class Template(metaclass=PoolMeta): __name__ = 'product.template' - positions = fields.One2Many('product_template.position','template', 'Positions') \ No newline at end of file + positions = fields.One2Many('product_template.position','template', 'Positions') + + @classmethod + def copy(cls, records, default=None): + if default is None: + default = {} + else: + default = default.copy() + default.setdefault('positions', None) + return super(Template, cls).copy(records, default=default) \ No newline at end of file