From ffb828337e124c748351a2780f78f3daf7d9dbbc Mon Sep 17 00:00:00 2001 From: Renzo Meister Date: Tue, 27 Dec 2022 10:16:19 +0100 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20wrong=20and/or=20check=20->l?= =?UTF-8?q?10n=5Fch=5Fbase=5Fbank?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_ch_base_bank/models/invoice.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/l10n_ch_base_bank/models/invoice.py b/l10n_ch_base_bank/models/invoice.py index 55bd4ba..5ade774 100644 --- a/l10n_ch_base_bank/models/invoice.py +++ b/l10n_ch_base_bank/models/invoice.py @@ -87,14 +87,13 @@ class AccountMove(models.Model): ) if ( bank_acc.acc_type not in ["qr-iban", 'iban'] - and ( - move.currency_id.name == "CHF" - and not bank_acc.l10n_ch_isr_subscription_chf - ) - or ( - move.currency_id.name == "EUR" - and not bank_acc.l10n_ch_isr_subscription_eur - ) + and (( + move.currency_id.name == "CHF" + and not bank_acc.l10n_ch_isr_subscription_chf + ) or ( + move.currency_id.name == "EUR" + and not bank_acc.l10n_ch_isr_subscription_eur + )) ): raise exceptions.ValidationError( _( From c19e530d6b72d7df5b3b65fe470ba570cfbc5483 Mon Sep 17 00:00:00 2001 From: Thomas Winteler Date: Tue, 9 May 2023 11:29:23 +0200 Subject: [PATCH 2/2] [FIX] l10n_ch_pain_base: check if partner bank is qr iban (reference_type no more set in F2) --- l10n_ch_pain_base/models/account_move_line.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ch_pain_base/models/account_move_line.py b/l10n_ch_pain_base/models/account_move_line.py index 4d62b05..d83d3ae 100644 --- a/l10n_ch_pain_base/models/account_move_line.py +++ b/l10n_ch_pain_base/models/account_move_line.py @@ -10,7 +10,7 @@ class AccountMoveLine(models.Model): def _prepare_payment_line_vals(self, payment_order): vals = super(AccountMoveLine, self)._prepare_payment_line_vals( payment_order) - if self.move_id and self.move_id.reference_type in ['isr', 'QRR', 'SCOR']: + if self.move_id and self.move_id.partner_bank_id._is_qr_iban(): if self.move_id.reference_type == 'isr': vals['local_instrument'] = 'CH01' if vals['communication']: