-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[16.0] IMP display currency for partner bank account
- Loading branch information
1 parent
4ee69f3
commit 252da11
Showing
4 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |