From aea045d446537e9daacc153865702eb76d8497b7 Mon Sep 17 00:00:00 2001 From: oco-odoo Date: Tue, 14 Jan 2020 12:58:07 +0000 Subject: [PATCH] [FIX] l10n_ch: don't assume the bank account of the company always has a currency_id Since this field is not required on res.partner.bank (which is fine: we want it to be synchronized with the journal's currency, which is None if the journal uses company currency), the parameter received by validate_swiss_code_arguments ended out being an empty recordset in case the company was directly in CHF. This caused the QR code to never be displayed in this situation. closes odoo/odoo#43351 X-original-commit: 60a55834b5ae0a8ac10914a243f97029d9921ae6 Signed-off-by: Laurent Smet --- 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 9a75c48b21e..b1bce8d1234 100644 --- a/addons/l10n_ch/models/res_bank.py +++ b/addons/l10n_ch/models/res_bank.py @@ -151,9 +151,8 @@ class ResPartnerBank(models.Model): qr_code_url = '/report/barcode/?type=%s&value=%s&width=%s&height=%s&humanreadable=1' % ('QR', werkzeug.url_quote_plus(qr_code_string), 256, 256) return qr_code_url - @api.model def validate_swiss_code_arguments(self, currency, debitor): - + currency = currency or self.company_id.currency_id t_street_comp = '%s %s' % (self.company_id.street if (self.company_id.street != False) else '', self.company_id.street2 if (self.company_id.street2 != False) else '') t_street_deb = '%s %s' % (debitor.street if (debitor.street != False) else '', debitor.street2 if (debitor.street2 != False) else '') number = self.find_number(t_street_comp)