From 672a72a964ef3e2541cbcedd5bb2aa00606e3e06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 2 Apr 2026 15:33:36 +0200 Subject: [PATCH] Do not match direct debit reception with SEPA mandate that is not validated Closes #14738 (grafted from d4c4995588f34828b90adf0fa53d85d9a6d3687f) --HG-- branch : 7.0 --- modules/account_payment_sepa/party.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/account_payment_sepa/party.py b/modules/account_payment_sepa/party.py index 3af55e60e4..a0a18a64a0 100644 --- a/modules/account_payment_sepa/party.py +++ b/modules/account_payment_sepa/party.py @@ -69,6 +69,13 @@ class PartyReceptionDirectDebit(metaclass=PoolMeta): payment.sepa_mandate = self.sepa_mandate return payment + def match(self, pattern, match_none=False): + result = super().match(pattern, match_none=match_none) + if (self.process_method == 'sepa' + and self.sepa_mandate.state != 'validated'): + result = False + return result + class PartyIdentifier(metaclass=PoolMeta): __name__ = 'party.identifier'