Skip to content

Commit

Permalink
[16.0] IMP display currency for partner bank account
Browse files Browse the repository at this point in the history
  • Loading branch information
mourad-ehm authored and bealdav committed May 6, 2024
1 parent 4ee69f3 commit 252da11
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
3 changes: 2 additions & 1 deletion account_usability_akretion/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
'wizard/account_payment_register_views.xml',
'security/ir.model.access.csv',
# 'report/invoice_report.xml', # TODO
],
"views/res_partner.xml",
],
# 'qweb': ['static/src/xml/account_payment.xml'],
'installable': True,
# "post_init_hook": "post_init_hook",
Expand Down
1 change: 1 addition & 0 deletions account_usability_akretion/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
from . import res_company
#from . import product
from . import account_invoice_report
from . import res_partner_bank
21 changes: 21 additions & 0 deletions account_usability_akretion/models/res_partner_bank.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2015-2022 Akretion France (http://www.akretion.com/)
# @author: Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models


class ResPartnerBank(models.Model):
_inherit = 'res.partner.bank'

def name_get(self):
res = []
for acc in self:
name = acc.acc_number
if acc.currency_id:
name = "%s (%s)" % (name, acc.currency_id.name)
if acc.bank_id.name:
name = "%s - %s" % (name, acc.bank_id.name)
res += [(acc.id, name)]
return res

20 changes: 20 additions & 0 deletions account_usability_akretion/views/res_partner.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2014-2024 Akretion (http://www.akretion.com/)
@author: Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->

<odoo>

<record id="view_partner_simple_form" model="ir.ui.view">
<field name="name">base_usability.title.on.partner.simplified.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="account.view_partner_property_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='bank_ids']//field[@name='acc_number']" position="after">
<field name="currency_id" optional="hide"/>
</xpath>
</field>
</record>
</odoo>

0 comments on commit 252da11

Please sign in to comment.