[MIG] account_usability_akretion to v18
Move code from account_usability_akretion to base_usability_akretion
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class ResPartnerBank(models.Model):
|
||||
@@ -12,3 +12,13 @@ class ResPartnerBank(models.Model):
|
||||
# displayed as 'Name', which the string of the related field it
|
||||
# points to
|
||||
bank_name = fields.Char(string='Bank Name')
|
||||
|
||||
@api.depends('currency_id')
|
||||
def _compute_display_name(self):
|
||||
for acc in self:
|
||||
name = acc.acc_number
|
||||
if acc.currency_id:
|
||||
name = f"{name} ({acc.currency_id.name})"
|
||||
if acc.bank_id:
|
||||
name = f"{name} - {acc.bank_id.name}"
|
||||
acc.display_name = name
|
||||
|
||||
Reference in New Issue
Block a user