Skip to content

Commit

Permalink
[FIX+IMP] account_payment_mode: Several small usability improvements …
Browse files Browse the repository at this point in the history
…+ fix

- FIX: Don't store acc_type of res.partner.bank (OCA#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.
  • Loading branch information
Alexis de Lattre authored and jaredkipe committed Dec 15, 2021
1 parent a1b1071 commit 141d17c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion account_payment_mode/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
10 changes: 10 additions & 0 deletions account_payment_mode/migrations/11.0.1.0.1/pre-migration.py
Original file line number Diff line number Diff line change
@@ -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')
10 changes: 7 additions & 3 deletions account_payment_mode/models/res_partner_bank.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
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')
4 changes: 2 additions & 2 deletions account_payment_mode/views/account_payment_mode.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
<field name="name"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="active"/>
<field name="payment_method_id" widget="selection"/>
<field name="payment_method_id"/>
<field name="payment_type"/>
<field name="bank_account_link"/>
<field name="fixed_journal_id"
attrs="{'invisible': [('bank_account_link', '!=', 'fixed')], 'required': [('bank_account_link', '=', 'fixed')]}"
domain="[('company_id', '=', company_id), ('type', '=', 'bank')]"
widget="selection"/>
/>
<field name="variable_journal_ids"
attrs="{'invisible': [('bank_account_link', '!=', 'variable')], 'required': [('bank_account_link', '=', 'variable')]}"
domain="[('company_id', '=', company_id), ('type', '=', 'bank')]"
Expand Down
14 changes: 0 additions & 14 deletions account_payment_mode/views/res_partner_bank.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>

0 comments on commit 141d17c

Please sign in to comment.