mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
Improvements include: - full re-organisation of modules and big re-organisation of the code - simplification of the code related to the fact that support for direct debit is now in t he base module, not added by an optional module account_direct_debit (module was removed) - new design of the wizard to select move lines to pay - support for non-SEPA file transfer- - support for German direct debit SEPA files (fixes bug #129) - remove workflow of payment.order This port to v9 is not finished... there is still a lot of work: - finish the code of account_payment_order/wizard/account_payment_line_create.py - port account_banking_payment_transfer and integrate it inside account_payment_order - fix bugs - clean-up code, remove dead code - test in several complex scenarios
23 lines
765 B
Python
23 lines
765 B
Python
# -*- coding: utf-8 -*-
|
|
# © 2015-2016 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
|
|
from openerp import models, api, _
|
|
from openerp.exceptions import ValidationError
|
|
|
|
|
|
class ResBank(models.Model):
|
|
_inherit = 'res.bank'
|
|
|
|
@api.multi
|
|
@api.constrains('bic')
|
|
def check_bic_length(self):
|
|
for bank in self:
|
|
if bank.bic and len(bank.bic) not in (8, 11):
|
|
raise ValidationError(_(
|
|
"A valid BIC contains 8 or 11 caracters. The BIC '%s' "
|
|
"contains %d caracters, so it is not valid.")
|
|
% (bank.bic, len(bank.bic)))
|
|
|
|
# in v9, on res.partner.bank bank_bic is a related of bank_id.bic
|