Skip to content
Snippets Groups Projects
Commit 60a55834 authored by oco-odoo's avatar oco-odoo
Browse files

[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#43282

Signed-off-by: default avatarLaurent Smet <smetl@users.noreply.github.com>
parent 84f70e4f
Branches
Tags
No related merge requests found
......@@ -123,9 +123,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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment