[FIX] l10n_ch: allow generating SEPA QR-code for Swiss customers

This commit https://github.com/odoo/odoo/commit/a9980477048e4adffda4a71a72ff1cc8490637f9 wrongly impeached to generate a SEPA QR-code on the invoice when l10n_ch was installed and the company and customer were in Switzerland. This was too restrictive, and broke the previous behavior, which allowed manually enabling the SEPA QR invoice by invoice if necessary. We restore the old behavior with this commit.

OPW 3516380

closes odoo/odoo#138395

X-original-commit: d5fe06d75369716925ff65cf3f34928e890fc932
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
This commit is contained in:
oco-odoo
2023-10-13 09:17:48 +00:00
parent e062e6f483
commit cdca92ded6
-3
View File
@@ -207,9 +207,6 @@ class ResPartnerBank(models.Model):
error_messages.append(_("The currency isn't EUR nor CHF."))
return '\r\n'.join(error_messages) if len(error_messages) > 1 else None
if qr_method == 'sct_qr' and not _get_error_for_ch_qr():
return _("When both parties are located in Switzerland, "
"you should use the Swiss QR code process.")
if qr_method == 'ch_qr':
return _get_error_for_ch_qr()
return super()._get_error_messages_for_qr(qr_method, debtor_partner, currency)