diff --git a/account_payment_mode/__openerp__.py b/account_payment_mode/__openerp__.py index a72465ab8..729bb0fd8 100644 --- a/account_payment_mode/__openerp__.py +++ b/account_payment_mode/__openerp__.py @@ -4,7 +4,7 @@ { 'name': 'Account Payment Mode', - 'version': '9.0.1.0.0', + 'version': '9.0.1.0.1', 'license': 'AGPL-3', 'author': "Akretion,Odoo Community Association (OCA)", 'website': 'https://github.com/OCA/bank-payment', diff --git a/account_payment_mode/migrations/9.0.1.0.1/pre-migration.py b/account_payment_mode/migrations/9.0.1.0.1/pre-migration.py new file mode 100644 index 000000000..873976730 --- /dev/null +++ b/account_payment_mode/migrations/9.0.1.0.1/pre-migration.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +def migrate(cr, version): + if not version: + return + + cr.execute('ALTER TABLE res_partner_bank DROP COLUMN acc_type') diff --git a/account_payment_mode/models/res_partner_bank.py b/account_payment_mode/models/res_partner_bank.py index 4e9b0a2a5..63a6ba1a0 100644 --- a/account_payment_mode/models/res_partner_bank.py +++ b/account_payment_mode/models/res_partner_bank.py @@ -8,6 +8,10 @@ from openerp import models, fields class ResPartnerBank(models.Model): _inherit = 'res.partner.bank' - # I also have to change the label of the field in the view - # I store the field, so that we can do groupby and search on it - acc_type = fields.Char(string='Bank Account Type', store=True) + # I change the label of the field in the view. + # I would also like to store the field to do easy groupby and search, + # but it's not possible because the compute method is inherited + # in base_iban (and maybe in other modules) and, when the field is + # initially computed+stored, it doesn't take into account the + # inherits of the method that compute this field + acc_type = fields.Char(string='Bank Account Type') diff --git a/account_payment_mode/views/res_partner_bank.xml b/account_payment_mode/views/res_partner_bank.xml index ebdc48ec2..617199f8f 100644 --- a/account_payment_mode/views/res_partner_bank.xml +++ b/account_payment_mode/views/res_partner_bank.xml @@ -26,20 +26,6 @@ detect wrong IBANs --> - - account_payment_mode.res_partner_bank_search - res.partner.bank - - - - - - - - - -