base_usability: add name_get() on ir.model.fields

Add patch to add technical field name in export dialog box
This commit is contained in:
Alexis de Lattre
2024-04-11 19:29:14 +02:00
parent 2c794033b0
commit 46fcf5c0ef
3 changed files with 38 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
# Copyright 2024 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, models
class IrModelFields(models.Model):
_inherit = 'ir.model.fields'
@api.depends('name', 'field_description')
def name_get(self):
res = []
for rec in self:
res.append((rec.id, '%s (%s)' % (rec.field_description, rec.name)))
return res