changeset d733f68563f1 in modules/account_stock_landed_cost:6.0
details:
https://hg.tryton.org/modules/account_stock_landed_cost?cmd=changeset&node=d733f68563f1
description:
Clear invoice lines when copying landed cost
issue11474
review427131003
(grafted from bbcd995376803e6f1a75885eb64f8ee59e8f3e77)
diffstat:
account.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diffs (16 lines):
diff -r 368edb139d9b -r d733f68563f1 account.py
--- a/account.py Fri Dec 03 21:54:01 2021 +0100
+++ b/account.py Wed May 11 11:26:36 2022 +0200
@@ -415,6 +415,12 @@
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'