From 5ff17ef33aabb65bea106c64a70441c926d7e45e Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sat, 14 Apr 2018 13:03:16 +0200 Subject: [PATCH] [FIX+IMP] account_payment_mode: Several small usability improvements + fix - FIX: Don't store acc_type of res.partner.bank (#467) - when manually encoding a payment line, get company currency as default currency - Search on payment order numbers - Direct search on bank journal name in payment orders - remove widget="selection" on account.payement.mode : this object is rarely modified, so widget='selection' is not a time saver, but we miss the HTML link, which can be pretty convenient to check the configuration. --- account_payment_mode/__manifest__.py | 2 +- .../migrations/11.0.1.0.1/pre-migration.py | 10 ++++++++++ account_payment_mode/models/res_partner_bank.py | 10 +++++++--- .../views/account_payment_mode.xml | 4 ++-- account_payment_mode/views/res_partner_bank.xml | 14 -------------- 5 files changed, 20 insertions(+), 20 deletions(-) create mode 100644 account_payment_mode/migrations/11.0.1.0.1/pre-migration.py diff --git a/account_payment_mode/__manifest__.py b/account_payment_mode/__manifest__.py index abaed0ef3..6ab7d6f85 100644 --- a/account_payment_mode/__manifest__.py +++ b/account_payment_mode/__manifest__.py @@ -4,7 +4,7 @@ { 'name': 'Account Payment Mode', - 'version': '11.0.1.0.0', + 'version': '11.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/11.0.1.0.1/pre-migration.py b/account_payment_mode/migrations/11.0.1.0.1/pre-migration.py new file mode 100644 index 000000000..873976730 --- /dev/null +++ b/account_payment_mode/migrations/11.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 fe5dae242..a87dfb801 100644 --- a/account_payment_mode/models/res_partner_bank.py +++ b/account_payment_mode/models/res_partner_bank.py @@ -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') diff --git a/account_payment_mode/views/account_payment_mode.xml b/account_payment_mode/views/account_payment_mode.xml index 79c707da1..edaec297c 100644 --- a/account_payment_mode/views/account_payment_mode.xml +++ b/account_payment_mode/views/account_payment_mode.xml @@ -10,13 +10,13 @@ - + + /> - - account_payment_mode.res_partner_bank_search - res.partner.bank - - - - - - - - - -