diff options
| author | Mathieu Duckerts-Antoine <dam@odoo.com> | 2020-08-10 14:27:58 +0000 |
|---|---|---|
| committer | Mathieu Duckerts-Antoine <dam@odoo.com> | 2020-08-12 08:52:20 +0000 |
| commit | ae58021255274d3733e58ee8b020ca275aaa430d (patch) | |
| tree | 926009fc46bb86c608d76044a3a4de52119555a2 /addons/web/static/src/js/views/graph/graph_model.js | |
| parent | fd6182443f68af3b6418195b13a4ab6c40599572 (diff) | |
[IMP] web: sample data in graph view
A previous commit has paved the way for displaying sample data in the
reporting views. The present commit brings the required changes to have
sample data in graph views.
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/graph/graph_model.js')
| -rw-r--r-- | addons/web/static/src/js/views/graph/graph_model.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/addons/web/static/src/js/views/graph/graph_model.js b/addons/web/static/src/js/views/graph/graph_model.js index 8679fafe4ff..b1bcddb47c2 100644 --- a/addons/web/static/src/js/views/graph/graph_model.js +++ b/addons/web/static/src/js/views/graph/graph_model.js @@ -35,7 +35,7 @@ return AbstractModel.extend({ * @returns {Object} */ __get: function () { - return _.extend({}, this.chart); + return Object.assign({ isSample: this.isSampleModel }, this.chart); }, /** * Initial loading. @@ -165,7 +165,12 @@ return AbstractModel.extend({ this.chart.comparisonFieldIndex = -1; } }, - + /** + * @override + */ + _isEmpty() { + return this.chart.dataPoints.length === 0; + }, /** * Fetch and process graph data. It is basically a(some) read_group(s) * with correct fields for each domain. We have to do some light processing |
