summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2017-08-31 18:32:36 +0200
committerqsm-odoo <qsm@odoo.com>2017-09-06 17:52:24 +0200
commitcf4f357647a9bf84da07e599c78f8f06b10b3a1c (patch)
tree312a9cdffd5d8f043dfbc3b72ee5b1478742a906 /addons/web/static/src/js
parentd5382abeaad4d93b8def7e63cd47a86baaba8f0b (diff)
[REF] web: review form view layout
The goal of this review is to have a layout which is correct to implement the enterprise side-chatter. This also removes/fixes deprecated community rules and xml templates.
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/views/form/form_renderer.js8
1 files changed, 5 insertions, 3 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 63d7fd44917..3cb22af5dfd 100644
--- a/addons/web/static/src/js/views/form/form_renderer.js
+++ b/addons/web/static/src/js/views/form/form_renderer.js
@@ -754,11 +754,9 @@ var FormRenderer = BasicRenderer.extend({
*/
_renderTagSheet: function (node) {
this.has_sheet = true;
- var $result = $('<div>').addClass('o_form_sheet_bg');
var $sheet = $('<div>').addClass('o_form_sheet');
$sheet.append(_.map(node.children, this._renderNode.bind(this)));
- $result.append($sheet);
- return $result;
+ return $sheet;
},
/**
* Main entry point for the rendering. From here, we call _renderNode on
@@ -797,6 +795,10 @@ var FormRenderer = BasicRenderer.extend({
// Set the new content of the form view, and toggle classnames
this.$el.html($newContent);
this.$el.toggleClass('o_form_nosheet', !this.has_sheet);
+ if (this.has_sheet) {
+ this.$el.children().not('.oe_chatter')
+ .wrapAll($('<div/>', {class: 'o_form_sheet_bg'}));
+ }
this.$el.toggleClass('o_form_editable', this.mode === 'edit');
this.$el.toggleClass('o_form_readonly', this.mode === 'readonly');