From 252da11a30ac4c12148c3e13de4dfeae8e9d3a48 Mon Sep 17 00:00:00 2001 From: Mourad Date: Mon, 6 May 2024 11:35:38 +0200 Subject: [PATCH] [16.0] IMP display currency for partner bank account --- account_usability_akretion/__manifest__.py | 3 ++- account_usability_akretion/models/__init__.py | 1 + .../models/res_partner_bank.py | 21 +++++++++++++++++++ .../views/res_partner.xml | 20 ++++++++++++++++++ 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 account_usability_akretion/models/res_partner_bank.py create mode 100644 account_usability_akretion/views/res_partner.xml diff --git a/account_usability_akretion/__manifest__.py b/account_usability_akretion/__manifest__.py index b8a2bbd9..9a25fdc7 100644 --- a/account_usability_akretion/__manifest__.py +++ b/account_usability_akretion/__manifest__.py @@ -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", diff --git a/account_usability_akretion/models/__init__.py b/account_usability_akretion/models/__init__.py index 95e28786..660e4334 100644 --- a/account_usability_akretion/models/__init__.py +++ b/account_usability_akretion/models/__init__.py @@ -9,3 +9,4 @@ from . import res_company #from . import product from . import account_invoice_report +from . import res_partner_bank diff --git a/account_usability_akretion/models/res_partner_bank.py b/account_usability_akretion/models/res_partner_bank.py new file mode 100644 index 00000000..7477e875 --- /dev/null +++ b/account_usability_akretion/models/res_partner_bank.py @@ -0,0 +1,21 @@ +# Copyright 2015-2022 Akretion France (http://www.akretion.com/) +# @author: Mourad EL HADJ MIMOUNE +# 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 + diff --git a/account_usability_akretion/views/res_partner.xml b/account_usability_akretion/views/res_partner.xml new file mode 100644 index 00000000..768904c6 --- /dev/null +++ b/account_usability_akretion/views/res_partner.xml @@ -0,0 +1,20 @@ + + + + + + + base_usability.title.on.partner.simplified.form + res.partner + + + + + + + +