From e34c5f91c5b1b9783c540aa4f72d248c74e0f131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Tarroja=20Caubet?= Date: Fri, 30 Aug 2024 23:57:05 +0200 Subject: [PATCH] Do not copy project works nor progresses when copying invoice line Closes #13369 (grafted from 1c267cd4cc2a87f17c6b2f2934a1fd81d8674b36) --HG-- branch : 6.0 --- modules/project_invoice/invoice.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/project_invoice/invoice.py b/modules/project_invoice/invoice.py index 865c5fde70..da2d4efbb7 100644 --- a/modules/project_invoice/invoice.py +++ b/modules/project_invoice/invoice.py @@ -8,6 +8,13 @@ from trytond.tools import grouped_slice class InvoiceLine(metaclass=PoolMeta): __name__ = 'account.invoice.line' + @classmethod + def copy(cls, lines, default=None): + default = default.copy() if default is not None else {} + default.setdefault('project_invoice_works') + default.setdefault('project_invoice_progresses') + return super().copy(lines, default=default) + @classmethod def delete(cls, lines): pool = Pool()