changeset 76b614fc37ae in modules/account_payment_sepa:5.4
details: 
https://hg.tryton.org/modules/account_payment_sepa?cmd=changeset;node=76b614fc37ae
description:
        Do not copy mandates when duplicate parties

        issue9034
        review266771002
        (grafted from 00a53d5e615e4741858533af7dea283ab2bbe8c0)
diffstat:

 party.py |  9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diffs (19 lines):

diff -r b291668a47fa -r 76b614fc37ae party.py
--- a/party.py  Mon Nov 04 12:53:29 2019 +0100
+++ b/party.py  Sun Feb 16 00:21:45 2020 +0100
@@ -46,6 +46,15 @@
                     values=select))
             table.drop_column('sepa_creditor_identifier')
 
+    @classmethod
+    def copy(cls, parties, default=None):
+        if default is None:
+            default = {}
+        else:
+            default = default.copy()
+        default.setdefault('sepa_mandates', [])
+        return super().copy(parties, default=default)
+
     def get_sepa_creditor_identifier_used(self, name):
         for identifier in self.identifiers:
             if identifier.type == 'sepa':

Reply via email to