1
# -*- encoding: utf-8 -*-
2
##############################################################################
4
# OpenERP, Open Source Management Solution
6
# Associazione OpenERP Italia (<http://www.openerp-italia.org>)
8
# This program is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU Affero General Public License as
10
# published by the Free Software Foundation, either version 3 of the
11
# License, or (at your option) any later version.
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU Affero General Public License for more details.
18
# You should have received a copy of the GNU Affero General Public License
19
# along with this program. If not, see <http://www.gnu.org/licenses/>.
21
#############################################################################
23
from osv import fields, osv
25
class res_bank(osv.osv):
28
'abi': fields.char('ABI', size=5),
29
'cab': fields.char('CAB', size=5),
32
class res_partner_bank(osv.osv):
33
_inherit = "res.partner.bank"
35
'bank_abi': fields.char('ABI', size=5),
36
'bank_cab': fields.char('CAB', size=5),
39
def onchange_bank_id(self, cr, uid, ids, bank_id, context=None):
40
result = super(res_partner_bank, self).onchange_bank_id(cr, uid, ids, bank_id, context=context)
42
bank = self.pool.get('res.bank').browse(cr, uid, bank_id, context=context)
43
result['value']['bank_abi'] = bank.abi
44
result['value']['bank_cab'] = bank.cab