[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 <jasonvanmalder@users.noreply.github.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user