summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/abstract_controller.js
diff options
context:
space:
mode:
authorMathieu Duckerts-Antoine <dam@odoo.com>2020-08-11 08:32:43 +0000
committerMathieu Duckerts-Antoine <dam@odoo.com>2020-08-12 08:52:20 +0000
commitfd6182443f68af3b6418195b13a4ab6c40599572 (patch)
treefd1a408104eb318ab6f139f0a47b937e0f2c5ad9 /addons/web/static/src/js/views/abstract_controller.js
parent06b8af3212e2debb7e364e0b429ec6c2db5214e8 (diff)
[IMP] web: sample data in reporting views (preparatory work)
The present commit brings the global changes necessary to have sample data in the reporting views. This includes several modifications/ fixes of the sample server (many of them for better visual results). Task ID: 2282196 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/abstract_controller.js')
-rw-r--r--addons/web/static/src/js/views/abstract_controller.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/abstract_controller.js b/addons/web/static/src/js/views/abstract_controller.js
index 2f819bff7a5..06baab7b55c 100644
--- a/addons/web/static/src/js/views/abstract_controller.js
+++ b/addons/web/static/src/js/views/abstract_controller.js
@@ -101,6 +101,7 @@ var AbstractController = mvc.Controller.extend(ActionMixin, {
await Promise.all(promises);
await this._update(this.initialState, { shouldUpdateSearchComponents: false });
this.updateButtons();
+ this.el.classList.toggle('o_view_sample_data', this.model.isInSampleMode());
},
/**
* @override
@@ -255,6 +256,7 @@ var AbstractController = mvc.Controller.extend(ActionMixin, {
];
await this.dp.add(Promise.all(promises));
this.updateButtons();
+ this.el.classList.toggle('o_view_sample_data', this.model.isInSampleMode());
},
//--------------------------------------------------------------------------
@@ -381,6 +383,9 @@ var AbstractController = mvc.Controller.extend(ActionMixin, {
* some buttons in the control panel, such as the current graph type for a
* graph view.
*
+ * FIXME: this hook should be synchronous, and called once async rendering
+ * has been done.
+ *
* @private
* @param {Object} state the state given by the model
* @param {Object} [params={}]
@@ -408,7 +413,6 @@ var AbstractController = mvc.Controller.extend(ActionMixin, {
}
this._pushState();
await Promise.all(promises);
- this.el.classList.toggle('o_view_sample_data', this.model.isInSampleMode());
},
/**
* Can be used to update the key 'cp_content'. This method is called in start and _update methods.