From fdd1a160dd5b2b2aaf7b1bffe7d7c6356fc185c8 Mon Sep 17 00:00:00 2001 From: David Blanco Bautista Date: Fri, 10 Sep 2021 19:33:26 +0200 Subject: [PATCH] Update SEPA mandate on party replace issue10553 review358871002 --- __init__.py | 3 +++ party.py | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/__init__.py b/__init__.py index 17457a9bad..f3223e03cc 100644 --- a/__init__.py +++ b/__init__.py @@ -18,6 +18,9 @@ def register(): account.Configuration, account.ConfigurationSepaMandateSequence, module='account_payment_sepa', type_='model') + Pool.register( + party.Replace, + module='account_payment_sepa', type_='wizard') Pool.register( payment.MandateReport, module='account_payment_sepa', type_='report') diff --git a/party.py b/party.py index 9ff547666f..6c24ed437b 100644 --- a/party.py +++ b/party.py @@ -108,3 +108,13 @@ class PartyIdentifier(metaclass=PoolMeta): elif self.type == 'es_nif': identifier['Id'] += self.sepa_es_suffix or '000' return identifier + + +class Replace(metaclass=PoolMeta): + __name__ = 'party.replace' + + @classmethod + def fields_to_replace(cls): + return super().fields_to_replace() + [ + ('account.payment.sepa.mandate', 'party'), + ]