mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[FIX] account_payment_mode: Don't store acc_type of res.partner.bank (#467)
This commit is contained in:
committed by
Pedro M. Baeza
parent
edc9adb56a
commit
8f27c93351
@@ -4,7 +4,7 @@
|
||||
|
||||
{
|
||||
'name': 'Account Payment Mode',
|
||||
'version': '10.0.1.0.1',
|
||||
'version': '10.0.1.0.2',
|
||||
'license': 'AGPL-3',
|
||||
'author': "Akretion,Odoo Community Association (OCA)",
|
||||
'website': 'https://github.com/OCA/bank-payment',
|
||||
|
||||
10
account_payment_mode/migrations/10.0.1.0.2/pre-migration.py
Normal file
10
account_payment_mode/migrations/10.0.1.0.2/pre-migration.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2018 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# 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')
|
||||
@@ -8,6 +8,10 @@ from odoo 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')
|
||||
|
||||
@@ -25,19 +25,5 @@ detect wrong IBANs -->
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_partner_bank_search" model="ir.ui.view">
|
||||
<field name="name">account_payment_mode.res_partner_bank_search</field>
|
||||
<field name="model">res.partner.bank</field>
|
||||
<field name="inherit_id" ref="base.view_partner_bank_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="partner_id" position="after">
|
||||
<group string="Group By" name="groupby">
|
||||
<filter name="acc_type_groupby" string="Bank Account Type"
|
||||
context="{'group_by': 'acc_type'}"/>
|
||||
</group>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user