[16.0] IMP display currency for partner bank account

This commit is contained in:
Mourad
2024-05-06 11:35:38 +02:00
committed by David Beal
parent 4ee69f3bff
commit 252da11a30
4 changed files with 44 additions and 1 deletions

View File

@@ -32,6 +32,7 @@
'wizard/account_payment_register_views.xml', 'wizard/account_payment_register_views.xml',
'security/ir.model.access.csv', 'security/ir.model.access.csv',
# 'report/invoice_report.xml', # TODO # 'report/invoice_report.xml', # TODO
"views/res_partner.xml",
], ],
# 'qweb': ['static/src/xml/account_payment.xml'], # 'qweb': ['static/src/xml/account_payment.xml'],
'installable': True, 'installable': True,

View File

@@ -9,3 +9,4 @@ from . import res_partner
from . import res_company from . import res_company
#from . import product #from . import product
from . import account_invoice_report from . import account_invoice_report
from . import res_partner_bank

View File

@@ -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

View File

@@ -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>