2018-09-22 03:28:30 +02:00
|
|
|
# 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):
|
2020-01-08 21:52:03 +01:00
|
|
|
_inherit = "ir.model.fields"
|
2018-09-22 03:28:30 +02:00
|
|
|
|
|
|
|
def name_get(self):
|
|
|
|
"""Return special label when showing fields in chart update wizard."""
|
2020-01-08 21:52:03 +01:00
|
|
|
if self.env.context.get("account_chart_update"):
|
2018-09-22 03:28:30 +02:00
|
|
|
res = []
|
|
|
|
for record in self:
|
2020-01-08 21:52:03 +01:00
|
|
|
res.append(
|
|
|
|
(record.id, "{} ({})".format(record.field_description, record.name))
|
|
|
|
)
|
2018-09-22 03:28:30 +02:00
|
|
|
return res
|
|
|
|
return super(IrModelFields, self).name_get()
|