[ADD] web_tooltip_field

This commit is contained in:
Cuong, Nguyen Minh Tran Manh
2023-03-03 15:47:52 +07:00
parent 4c337c3f61
commit f63c4ff538
15 changed files with 221 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import test_field

View File

@@ -0,0 +1,30 @@
# Copyright 2023 Komit - Cuong Nguyen Mtm
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.tests import common
class TestField(common.SavepointCase):
@classmethod
def setUpClass(cls):
super(TestField, cls).setUpClass()
def test_field_description_help(self):
contact_user_id_field = self.env["res.partner"]._fields["user_id"]
self.assertEqual(
contact_user_id_field._description_help(self.env),
"The internal user in charge of this contact.",
)
contact_user_id_field_rec = self.env["ir.model.fields"].search(
[
("model", "=", "res.partner"),
("name", "=", "user_id"),
],
limit=1,
)
self.env["ir.model.fields.help.tooltip"].create(
{"field_id": contact_user_id_field_rec.id, "help": "This is a test help."}
)
self.assertEqual(
contact_user_id_field._description_help(self.env), "This is a test help."
)