changeset ae448d84e575 in modules/account_stock_landed_cost:6.4
details: 
https://hg.tryton.org/modules/account_stock_landed_cost?cmd=changeset&node=ae448d84e575
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 a9b97f09ebe0 -r ae448d84e575 account.py
--- a/account.py        Mon May 02 17:12:35 2022 +0200
+++ b/account.py        Wed May 11 11:26:36 2022 +0200
@@ -422,6 +422,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'

Reply via email to