2
0
account-financial-tools/account_chart_update/models/ir_model_fields.py
2023-01-17 08:54:49 +01:00

20 lines
628 B
Python

# Copyright 2018 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
class IrModelFields(models.Model):
_inherit = "ir.model.fields"
def name_get(self):
"""Return special label when showing fields in chart update wizard."""
if self.env.context.get("account_chart_update"):
res = []
for record in self:
res.append(
(record.id, "{} ({})".format(record.field_description, record.name))
)
return res
return super(IrModelFields, self).name_get()