[IMP] l10n_ch: clearer validations for bank fields and vendor bills (ISR ref)
On res.partner.bank, we check that: - l10n_ch_postal contains a valid postal number - l10n_ch_isr_subscription_chf contains a valid ISR subscription number - l10n_ch_isr_subscription_eur contains a valid ISR subscription number ISR subscriptions numbers are postal numbers but starting with 01 or 03. Those codes are reserved to ISR issuance. When the bank account on a Vendor Bill is detected as an ISR Issuer, check the reference is actually an ISR. The 27 digits ISR Reference is error prone when typed by hand and an error at this stage would break the payment process later. This is required to avoid batch payment error with SEPA. We prefer using the pretty form xx-yyyyy-z of a postal account. The Swiss users will identify it more easily. We always want to auto fill the field l10n_ch_postal when possible from acc_number, which includes only 2 cases of filling acc_number: 1. a 9 position postal account number 2. an IBAN from PostFinance which includes clearing 09000 Original prs: Closes #51645, #51544, #51560 closes odoo/odoo#54455 X-original-commit: f8a3ec438e3b5fa56305db729a78304aec7a6716 Signed-off-by:Quentin De Paoli (qdp) <qdp@openerp.com> Signed-off-by:
Josse Colpaert <jco@openerp.com>
Showing
- addons/l10n_ch/i18n_extra/l10n_ch.pot 41 additions, 13 deletionsaddons/l10n_ch/i18n_extra/l10n_ch.pot
- addons/l10n_ch/models/account_invoice.py 29 additions, 1 deletionaddons/l10n_ch/models/account_invoice.py
- addons/l10n_ch/models/res_bank.py 83 additions, 11 deletionsaddons/l10n_ch/models/res_bank.py
- addons/l10n_ch/tests/__init__.py 3 additions, 1 deletionaddons/l10n_ch/tests/__init__.py
- addons/l10n_ch/tests/test_l10n_ch_isr_print.py 1 addition, 1 deletionaddons/l10n_ch/tests/test_l10n_ch_isr_print.py
- addons/l10n_ch/tests/test_onchange_l10n_ch_postal.py 108 additions, 0 deletionsaddons/l10n_ch/tests/test_onchange_l10n_ch_postal.py
- addons/l10n_ch/tests/test_swissqr.py 4 additions, 4 deletionsaddons/l10n_ch/tests/test_swissqr.py
- addons/l10n_ch/tests/test_vendor_bill_isr.py 119 additions, 0 deletionsaddons/l10n_ch/tests/test_vendor_bill_isr.py
- addons/l10n_ch/views/account_invoice_view.xml 6 additions, 0 deletionsaddons/l10n_ch/views/account_invoice_view.xml
Loading
Please register or sign in to comment