From a2d6cb4da328bf86b23fad3276adae8bc6289bd5 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Fri, 2 Jun 2017 14:14:47 +0200 Subject: [PATCH] Clear landed cost relation when copying invoices issue6531 review42371002 --- account.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/account.py b/account.py index ffa30f0574..37b8234577 100644 --- a/account.py +++ b/account.py @@ -325,3 +325,12 @@ class InvoiceLine: def __setup__(cls): super(InvoiceLine, cls).__setup__() cls._check_modify_exclude.add('landed_cost') + + @classmethod + def copy(cls, lines, default=None): + if default is None: + default = {} + else: + default = default.copy() + default.setdefault('landed_cost', None) + return super(InvoiceLine, cls).copy(lines, default=default)