changeset 9149871fdc8d in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset;node=9149871fdc8d
description:
Add help text to Dict keys
issue8801
review284371002
diffstat:
CHANGELOG | 1 +
doc/ref/models/models.rst | 5 +++++
trytond/ir/message.xml | 3 +++
trytond/model/dictschema.py | 4 ++++
4 files changed, 13 insertions(+), 0 deletions(-)
diffs (57 lines):
diff -r f4ea454f5131 -r 9149871fdc8d CHANGELOG
--- a/CHANGELOG Wed Dec 11 22:19:04 2019 +0100
+++ b/CHANGELOG Wed Dec 11 22:25:51 2019 +0100
@@ -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
diff -r f4ea454f5131 -r 9149871fdc8d doc/ref/models/models.rst
--- a/doc/ref/models/models.rst Wed Dec 11 22:19:04 2019 +0100
+++ b/doc/ref/models/models.rst Wed Dec 11 22:25:51 2019 +0100
@@ -618,6 +618,11 @@
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
diff -r f4ea454f5131 -r 9149871fdc8d trytond/ir/message.xml
--- a/trytond/ir/message.xml Wed Dec 11 22:19:04 2019 +0100
+++ b/trytond/ir/message.xml Wed Dec 11 22:25:51 2019 +0100
@@ -60,6 +60,9 @@
<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>
diff -r f4ea454f5131 -r 9149871fdc8d trytond/model/dictschema.py
--- a/trytond/model/dictschema.py Wed Dec 11 22:19:04 2019 +0100
+++ b/trytond/model/dictschema.py Wed Dec 11 22:25:51 2019 +0100
@@ -30,6 +30,9 @@
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 @@
'id': record.id,
'name': record.name,
'string': record.string,
+ 'help': record.help,
'type': record.type_,
'domain': record.domain,
'sequence': getattr(record, 'sequence', record.name),