Files
odoo_source/addons/l10n_ch/wizard/setup_wizards.py
T
oco-odoo d9c97e8cd1 [REM] l10n_ch_qr_iban: merge module into l10n_ch
This module had been introduced in stable to add a field to store the QR-IBAN in case it differed from the regular account number. We now merge it into the original module and make it so that the only way to define a QR-IBAN is to populate this field (no more magic with account number).
2021-04-01 17:06:11 +00:00

17 lines
706 B
Python

# -*- coding: utf-8 -*-
from odoo import api, models
class SwissSetupBarBankConfigWizard(models.TransientModel):
_inherit = 'account.setup.bank.manual.config'
@api.onchange('acc_number')
def _onchange_recompute_qr_iban(self):
# Needed because ORM doesn't properly call the compute in 'new' mode, due to inherits, and
# we want this field to be displayed in the wizard. We need to manually set acc_number
# on the inherits m2o before calling the compute function manually.
self.res_partner_bank_id.acc_number = self.acc_number
self.res_partner_bank_id._compute_l10n_ch_qr_iban()
self.l10n_ch_qr_iban = self.res_partner_bank_id.l10n_ch_qr_iban