Add help text to Dict keys

issue8801
review284371002
This commit is contained in:
Cédric Krier
2019-12-11 22:25:51 +01:00
parent e0b48d3f21
commit 0ff927977d
4 changed files with 13 additions and 0 deletions
+1
View File
@@ -1,3 +1,4 @@
* Add help text to Dict keys
* Update button_action with returned values
* Use direct access to backend classes
* Add weasyprint support
+5
View File
@@ -618,6 +618,11 @@ Class attributes are:
The definition of the :class:`trytond.model.fields.Char` field for the
string of the key.
.. attribute:: DictSchemaMixin.help
The definition of the :class:`trytond.model.fields.Char` field used as the
help text for the key.
.. attribute:: DictSchemaMixin.type\_
The definition of the :class:`trytond.model.fields.Selection` field for the
+3
View File
@@ -60,6 +60,9 @@ this repository contains the full copyright notices and license terms. -->
<record model="ir.message" id="msg_dict_schema_string">
<field name="text">String</field>
</record>
<record model="ir.message" id="msg_dict_schema_help">
<field name="text">Help</field>
</record>
<record model="ir.message" id="msg_dict_schema_type">
<field name="text">Type</field>
</record>
+4
View File
@@ -30,6 +30,9 @@ class DictSchemaMixin(object):
string = fields.Char(
lazy_gettext('ir.msg_dict_schema_string'),
translate=True, required=True)
help = fields.Text(
lazy_gettext('ir.msg_dict_schema_help'),
translate=True)
type_ = fields.Selection([
('boolean', lazy_gettext('ir.msg_dict_schema_boolean')),
('integer', lazy_gettext('ir.msg_dict_schema_integer')),
@@ -139,6 +142,7 @@ class DictSchemaMixin(object):
'id': record.id,
'name': record.name,
'string': record.string,
'help': record.help,
'type': record.type_,
'domain': record.domain,
'sequence': getattr(record, 'sequence', record.name),