From bde09810c7bb71230b0f59ba07a7a1588dc1cb14 Mon Sep 17 00:00:00 2001 From: Jason Van Malder Date: Tue, 3 Dec 2019 07:55:32 +0000 Subject: [PATCH] [FIX] l10n_ch: fix isr report crash with studio Issue - Swiss company - Install Accounting & Studio - Journals > Customers Invoice - Communication standard: Switzerland - Journals > Bank - Swizz account with CHF ISR subscription number - Studio > Reports > ISR Traceback Cause If the statement of the `l10n_ch_isr_optical_line` compute method is False, the value will be `None`. In the view, we do a foreach on the value which is `None` and it crashes. Solution Set an empty string as default value for the `l10n_ch_isr_optical_line` field OPW-2129122 closes odoo/odoo#41247 X-original-commit: a0dc556b0e04c9e89e7f6a8e4e9af045151614f7 Signed-off-by: Jason Van Malder --- addons/l10n_ch/models/account_invoice.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/l10n_ch/models/account_invoice.py b/addons/l10n_ch/models/account_invoice.py index d68d786e12b..25ea490668d 100644 --- a/addons/l10n_ch/models/account_invoice.py +++ b/addons/l10n_ch/models/account_invoice.py @@ -124,6 +124,7 @@ class AccountMove(models.Model): bank supporting the ISR (including the zeros). """ for record in self: + record.l10n_ch_isr_optical_line = '' if record.l10n_ch_isr_number and record.l10n_ch_isr_subscription and record.currency_id.name: #Left part currency_code = None