mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[ADD] Module that allows preservation of the domestic account number
for IBAN accounts in preparation of the upgrade to OpenERP 6.1
This commit is contained in:
1
account_iban_preserve_domestic/__init__.py
Normal file
1
account_iban_preserve_domestic/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
import res_partner_bank
|
||||
57
account_iban_preserve_domestic/__openerp__.py
Normal file
57
account_iban_preserve_domestic/__openerp__.py
Normal file
@@ -0,0 +1,57 @@
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (C) 2012 Therp BV (<http://therp.nl>).
|
||||
#
|
||||
# All other contributions are (C) by their respective contributors
|
||||
#
|
||||
# All Rights Reserved
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract EduSense BV
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
{
|
||||
'name': 'Preserve domestic bank account number',
|
||||
'version': '0.1',
|
||||
'license': 'GPL-3',
|
||||
'author': 'Therp BV',
|
||||
'website': 'https://launchpad.net/banking-addons',
|
||||
'category': 'Banking addons',
|
||||
'depends': ['base_iban'],
|
||||
'init_xml': [],
|
||||
'update_xml': [],
|
||||
'demo_xml': [],
|
||||
'description': '''
|
||||
This module is compatible with OpenERP 6.0.
|
||||
|
||||
The IBAN module in OpenERP 6.1 registers the IBAN
|
||||
on the same field as the domestic account number,
|
||||
instead of keeping both on separate fields as is the
|
||||
case in 6.0. That means that an upgrade to OpenERP 6.1
|
||||
makes you lose this information. If you want to keep
|
||||
the domestic account number in addition to the IBAN,
|
||||
install this module prior to the upgrade to OpenERP 6.1.
|
||||
|
||||
Do *not* install this version of the module on OpenERP 6.1.
|
||||
A dedicated module for OpenERP 6.1 will be available that
|
||||
allows you to access the domestic account number.
|
||||
''',
|
||||
'active': False,
|
||||
'installable': True,
|
||||
}
|
||||
29
account_iban_preserve_domestic/res_partner_bank.py
Normal file
29
account_iban_preserve_domestic/res_partner_bank.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from osv import fields,osv
|
||||
class res_partner_bank(osv.osv):
|
||||
'''Bank Accounts'''
|
||||
_inherit = "res.partner.bank"
|
||||
|
||||
def _get_domestic(self, cr, uid, ids, prop, unknow_none, context=None):
|
||||
import pdb
|
||||
pdb.set_trace()
|
||||
res = dict(
|
||||
[(x['id'], x['acc_number'])
|
||||
for x in self.read(cr, uid, ids, ['acc_number'], context=context)
|
||||
]
|
||||
)
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'acc_number_domestic': fields.function(
|
||||
_get_domestic, method=True, type="char",
|
||||
size=64, string='Domestic Account Number',
|
||||
store = {
|
||||
'res.partner.bank':(
|
||||
lambda self,cr,uid,ids,c={}:ids,
|
||||
['acc_number'], 10),
|
||||
},
|
||||
),
|
||||
}
|
||||
|
||||
res_partner_bank()
|
||||
|
||||
Reference in New Issue
Block a user