[FIX] account/l10n_ch : remove blocking condition on _get_available_qr_methods

Since 16.2, a condition was added to _get_available_qr_methods :
        if self.env.company.country_id.code == 'CH':
            rslt.append(('ch_qr', _("Swiss QR bill"), 10))

This condition was not allowing a multi-company call, and caused another issue.

Once the method was called to check on the eligible QR choices, the ORM would consider the current company to be the US default one.

Hence the condition would never be fulfilled and a stacktrace would appear :

Oh snap!
Wrong value for account.move.qr_code_method: 'ch_qr'

Reverted back to the unconditional behaviour, and will check this occurence with the framework team.

closes odoo/odoo#115952

X-original-commit: cdba8a062985bfbdcbe8d51aa9705e702b4dee61
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Camille Spiritus (casp) <casp@odoo.com>
This commit is contained in:
Camille Spiritus
2023-03-21 08:31:11 +01:00
parent 45ae6ad15c
commit 055af0b0af
+1 -2
View File
@@ -388,6 +388,5 @@ class ResPartnerBank(models.Model):
@api.model
def _get_available_qr_methods(self):
rslt = super()._get_available_qr_methods()
if self.env.company.country_id.code == 'CH':
rslt.append(('ch_qr', _("Swiss QR bill"), 10))
rslt.append(('ch_qr', _("Swiss QR bill"), 10))
return rslt