changeset 73152a5d094d in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset;node=73152a5d094d
description:
        Manage named separator as label

        issue8961
        review262741032
diffstat:

 CHANGELOG                                |  1 +
 tryton/gui/window/view_form/view/form.py |  6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diffs (31 lines):

diff -r 3389a6d1eaba -r 73152a5d094d CHANGELOG
--- a/CHANGELOG Fri Jan 24 00:18:19 2020 +0100
+++ b/CHANGELOG Fri Jan 24 00:25:30 2020 +0100
@@ -1,3 +1,4 @@
+* Manage named separator as label
 * Add MultiSelection entry to Dict field
 * Position new record based on order
 * Allow relation field to be selected in CSV export
diff -r 3389a6d1eaba -r 73152a5d094d tryton/gui/window/view_form/view/form.py
--- a/tryton/gui/window/view_form/view/form.py  Fri Jan 24 00:18:19 2020 +0100
+++ b/tryton/gui/window/view_form/view/form.py  Fri Jan 24 00:25:30 2020 +0100
@@ -264,6 +264,10 @@
         self.container.add(image, attributes)
 
     def _parse_separator(self, node, attributes):
+        name = attributes.get('name')
+        if name and name == self.exclude_field:
+            self.container.add(None, attributes)
+            return
         vbox = VBox(attrs=attributes)
         if attributes.get('string'):
             label = Label(label=attributes['string'], attrs=attributes)
@@ -275,6 +279,8 @@
                     bool(attributes.get('yexpand', False))))
             vbox.pack_start(label, expand=True, fill=True, padding=0)
             self.view.state_widgets.append(label)
+            if name:
+                self._mnemonics[name] = label
         vbox.pack_start(Gtk.HSeparator(), expand=True, fill=True, padding=0)
         self.view.state_widgets.append(vbox)
         self.container.add(vbox, attributes)

Reply via email to