Add name_get() on ir.model

Show state on sale.order tree view
This commit is contained in:
Alexis de Lattre
2019-07-30 23:06:07 +02:00
parent 4b442bd11b
commit dbd600bcd9
3 changed files with 20 additions and 0 deletions

View File

@@ -3,3 +3,4 @@ from . import partner
from . import company
from . import mail
from . import misc
from . import ir_model

View File

@@ -0,0 +1,16 @@
# Copyright 2019 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 IrModel(models.Model):
_inherit = 'ir.model'
@api.depends('name', 'model')
def name_get(self):
res = []
for rec in self:
res.append((rec.id, '%s (%s)' % (rec.name, rec.model)))
return res

View File

@@ -48,6 +48,9 @@
<field name="amount_total" position="before">
<field name="amount_untaxed" sum="Total Untaxed"/>
</field>
<field name="state" position="attributes">
<attribute name="invisible">0</attribute>
</field>
</field>
</record>