From eed756c15c278899f35b5443ebdd155ea9d3cfeb Mon Sep 17 00:00:00 2001 From: Maxime Richez Date: Wed, 11 May 2022 11:26:36 +0200 Subject: [PATCH] Clear invoice lines when copying landed cost issue11474 review427131003 --- account.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/account.py b/account.py index d451d9e8d5..e88ff9bd20 100644 --- a/account.py +++ b/account.py @@ -422,6 +422,12 @@ class LandedCost(Workflow, ModelSQL, ModelView, MatchMixin): company=values.get('company', default_company)).get() return super(LandedCost, cls).create(vlist) + @classmethod + def copy(cls, landed_costs, default=None): + default = default.copy() if default is not None else {} + default.setdefault('invoice_lines', None) + return super().copy(landed_costs, default=default) + class LandedCost_Shipment(ModelSQL): 'Landed Cost - Shipment'