Adding this field to the bank journal's form view had been done to ease encoding; yet more fields were left to be set on the related res.partner.bank object (l10n_ch_qr_iban, chf and eur subrscription numbers. In the end, to be consistent, we would have needed to do related fields for all of them as well on the journal. This would have put too many advanced features in a single screen. Instead, we just consider the whole setup needs to be done directly on the res.partner.bank. Task 2412391
18 lines
575 B
Python
18 lines
575 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import models, fields, api
|
|
|
|
from odoo.exceptions import ValidationError
|
|
|
|
from odoo.addons.base_iban.models.res_partner_bank import validate_iban
|
|
from odoo.addons.base.models.res_bank import sanitize_account_number
|
|
|
|
|
|
class AccountJournal(models.Model):
|
|
_inherit = 'account.journal'
|
|
|
|
invoice_reference_model = fields.Selection(selection_add=[
|
|
('ch', 'Switzerland')
|
|
], ondelete={'ch': lambda recs: recs.write({'invoice_reference_model': 'odoo'})})
|