[MIG] account_usability_akretion to v18

Move code from account_usability_akretion to base_usability_akretion
This commit is contained in:
Alexis de Lattre
2024-12-31 01:02:50 +01:00
parent 8e5d3b8a74
commit bdf4a527de
40 changed files with 298 additions and 567 deletions

View File

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