diff --git a/sao/src/view/form.js b/sao/src/view/form.js index 0a6d306fd1..5abbe39614 100644 --- a/sao/src/view/form.js +++ b/sao/src/view/form.js @@ -181,7 +181,6 @@ function eval_pyson(value){ var group = new Sao.View.Form.Container( Number(node.getAttribute('col') || 4)); this.view.containers.push(group); - this.parse_child(node, group); if (attributes.xalign === undefined) { attributes.xalign = 0.5; @@ -206,6 +205,9 @@ function eval_pyson(value){ this.view.state_widgets.push(widget); this.container.add(widget, attributes); + // Parse the children at the end to preserve the order of the state + // widgets + this.parse_child(node, group); }, _parse_hpaned: function(node, attributes) { this._parse_paned(node, attributes, 'horizontal'); diff --git a/tryton/tryton/gui/window/view_form/view/form.py b/tryton/tryton/gui/window/view_form/view/form.py index 246b327028..aeb1315006 100644 --- a/tryton/tryton/gui/window/view_form/view/form.py +++ b/tryton/tryton/gui/window/view_form/view/form.py @@ -379,7 +379,6 @@ class FormXMLViewParser(XMLViewParser): group = Container.constructor( int(attributes.get('col', 4)), attributes.get('homogeneous', False)) - self.parse_child(node, group) if 'name' in attributes and attributes['name'] == self.exclude_field: self.container.add(None, attributes) @@ -403,6 +402,9 @@ class FormXMLViewParser(XMLViewParser): bool(attributes.get('yexpand')))) self.view.state_widgets.append(widget) self.container.add(widget, attributes) + # Parse the children at the end to preserve the order of the state + # widgets + self.parse_child(node, group) def _parse_hpaned(self, node, attributes): self._parse_paned(node, attributes, Gtk.HPaned)