diff --git a/addons/l10n_ch/i18n/l10n_ch.pot b/addons/l10n_ch/i18n/l10n_ch.pot index 2035ed647d1..a5663c931cc 100644 --- a/addons/l10n_ch/i18n/l10n_ch.pot +++ b/addons/l10n_ch/i18n/l10n_ch.pot @@ -90,7 +90,7 @@ msgstr "" #. module: l10n_ch #: model_terms:ir.ui.view,arch_db:l10n_ch.l10n_ch_swissqr_template -msgid "Some of this informations are not set corrrectly to display the Swiss QR Code.
\n" +msgid "Some pieces of this information are not set correctly to display the Swiss QR Code.
\n" " -Bank > CHF ISR reference
\n" " -Bank > EUR ISR reference
\n" " -Your company > Street with number
\n" diff --git a/addons/l10n_ch/models/account_invoice.py b/addons/l10n_ch/models/account_invoice.py index 6373d00f8a7..8b402d14e99 100644 --- a/addons/l10n_ch/models/account_invoice.py +++ b/addons/l10n_ch/models/account_invoice.py @@ -133,15 +133,22 @@ class AccountInvoice(models.Model): record.l10n_ch_currency_name in ['EUR', 'CHF'] def split_total_amount(self): - """ Splits the total amount of this invoice in two parts, using the dot as - a separator, and taking two precision digits (always displayed). - These two parts are returned as the two elements of a tuple, as strings - to print in the report. + """ Splits the total amount of this invoice in two parts, using the dot as + a separator, and taking two precision digits (always displayed). + These two parts are returned as the two elements of a tuple, as strings + to print in the report. - This function is needed on the model, as it must be called in the report - template, which cannot reference static functions - """ - return float_split_str(self.amount_total, 2) + This function is needed on the model, as it must be called in the report + template, which cannot reference static functions + """ + return float_split_str(self.amount_total, 2) + + def display_swiss_qr_code(self): + """ Trigger the print of the Swiss QR code in the invoice report or not + """ + self.ensure_one() + qr_parameter = self.env['ir.config_parameter'].sudo().get_param('l10n_ch.print_qrcode') + return self.partner_id.country_id.code == 'CH' and qr_parameter def isr_print(self): """ Triggered by the 'Print ISR' button. diff --git a/addons/l10n_ch/report/swissqr_report.xml b/addons/l10n_ch/report/swissqr_report.xml index 37dc2b0f6b4..46ab9a8db26 100644 --- a/addons/l10n_ch/report/swissqr_report.xml +++ b/addons/l10n_ch/report/swissqr_report.xml @@ -4,7 +4,7 @@