diff --git a/sao/src/view/form.js b/sao/src/view/form.js index 01c89a917a..fbb6e1b35d 100644 --- a/sao/src/view/form.js +++ b/sao/src/view/form.js @@ -236,7 +236,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; @@ -261,6 +260,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 f3962fe577..5dd2fce445 100644 --- a/tryton/tryton/gui/window/view_form/view/form.py +++ b/tryton/tryton/gui/window/view_form/view/form.py @@ -382,7 +382,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) @@ -406,6 +405,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)