setup_wizards.py 706 B

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