From 055af0b0afc3827b35c307d1a7b72f6d62fa4bf7 Mon Sep 17 00:00:00 2001 From: Camille Spiritus Date: Fri, 17 Mar 2023 15:26:00 +0000 Subject: [PATCH] [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) Signed-off-by: Camille Spiritus (casp) --- addons/l10n_ch/models/res_bank.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/l10n_ch/models/res_bank.py b/addons/l10n_ch/models/res_bank.py index 3c5dc697bfb..a06542d2d81 100644 --- a/addons/l10n_ch/models/res_bank.py +++ b/addons/l10n_ch/models/res_bank.py @@ -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