From 424b01299b13acd79d4cb889cd92a9b42c969e1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 19 Feb 2025 23:37:00 +0100 Subject: [PATCH] Test SEPA mandate sequence of the company of the mandate instead of the context Closes #13882 (grafted from fd065f036503c116574e45bccd836b240d248a02) --HG-- branch : 6.0 --- modules/account_payment_sepa/payment.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/account_payment_sepa/payment.py b/modules/account_payment_sepa/payment.py index 3b43408a6c..c5fa9b4a5d 100644 --- a/modules/account_payment_sepa/payment.py +++ b/modules/account_payment_sepa/payment.py @@ -596,11 +596,12 @@ class Mandate(Workflow, ModelSQL, ModelView): vlist = [v.copy() for v in vlist] default_company = cls.default_company() for values in vlist: - if (config.sepa_mandate_sequence - and not values.get('identification')): - values['identification'] = config.get_multivalue( + if not values.get('identification'): + sequence = config.get_multivalue( 'sepa_mandate_sequence', - company=values.get('company', default_company)).get() + company=values.get('company', default_company)) + if sequence: + values['identification'] = sequence.get() # Prevent raising false unique constraint if values.get('identification') == '': values['identification'] = None