diff options
| author | Martin Geubelle <mge@odoo.com> | 2017-03-29 14:50:11 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-04-11 19:44:38 +0200 |
| commit | 043384d72fafa86a550e5b8545c2e2d520f207fe (patch) | |
| tree | 12556f00befaf92cf3d687149717b8f7cd994c81 /addons/web/static | |
| parent | caf0ec37a667646bd54782ee4fab416482c1ea6a (diff) | |
[REF] web: make _render functions overridable
As `_renderInnerGroupRow` is returning the row, appended to the
previous result, and not only the row, it was not possible to
override the method to add, for example, another row.
This commit doesn't change the behaviour, only the return of
private functions.
Diffstat (limited to 'addons/web/static')
| -rw-r--r-- | addons/web/static/src/js/views/form/form_renderer.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/addons/web/static/src/js/views/form/form_renderer.js b/addons/web/static/src/js/views/form/form_renderer.js index 285b7349ada..2370b1af19a 100644 --- a/addons/web/static/src/js/views/form/form_renderer.js +++ b/addons/web/static/src/js/views/form/form_renderer.js @@ -392,7 +392,7 @@ return BasicRenderer.extend({ fieldNodes.push(children[i+1]); i++; } - $result = this._renderInnerGroupRow($result, fieldNodes); + $result.append(this._renderInnerGroupRow(fieldNodes)); } else if (children[i].tag === 'label') { var label = children[i]; // If there is a "for" attribute, we expect to have an id concerned in the next node. @@ -425,17 +425,18 @@ return BasicRenderer.extend({ return $result.append($tr); }, /** + * Render a group row, with all the nodes inside. + * * @private - * @param {jQueryElement} $result * @param {Object[]} nodes * @returns {jQueryElement} */ - _renderInnerGroupRow: function ($result, nodes) { + _renderInnerGroupRow: function (nodes) { var $tr = $('<tr>'); for (var i = 0; i < nodes.length; i++) { $tr.append(this._renderInnerField(nodes[i]).contents()); } - return $result.append($tr); + return $tr; }, /** * Render a node, from the arch of the view. It is a generic method, that |
