diff options
| author | jbm-odoo <jbm@odoo.com> | 2019-12-04 14:51:43 +0000 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2020-01-28 10:28:33 +0000 |
| commit | ffe324877d6ff2817aefc3a324347280d9cd8039 (patch) | |
| tree | 2dfd5b0ffcdc6fc044bbaeb26f97caecc657e6c5 /addons/web/static/src/js/views/graph | |
| parent | b4f1c8fe955366dc4c3478acf508092816ca9728 (diff) | |
[IMP] timesheet: Improve timesheet report
Some small improvements in timesheet report view.
In measures of graph, take string attribute into account.
closes odoo/odoo#41348
Taskid: 2149371
Related: odoo/enterprise#7041
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/graph')
| -rw-r--r-- | addons/web/static/src/js/views/graph/graph_view.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/addons/web/static/src/js/views/graph/graph_view.js b/addons/web/static/src/js/views/graph/graph_view.js index c3ad22f6ced..64c65694784 100644 --- a/addons/web/static/src/js/views/graph/graph_view.js +++ b/addons/web/static/src/js/views/graph/graph_view.js @@ -46,6 +46,8 @@ var GraphView = AbstractView.extend({ var groupableFields = {}; this.fields.__count__ = {string: _t("Count"), type: "integer"}; + var measureString = {}; + this.arch.children.forEach(function (field) { var fieldName = field.attrs.name; if (fieldName === "id") { @@ -61,6 +63,9 @@ var GraphView = AbstractView.extend({ } else { groupBys.push(fieldName); } + if (field.attrs.string) { + measureString[fieldName] = field.attrs.string; + } }); _.each(this.fields, function (field, name) { @@ -75,6 +80,12 @@ var GraphView = AbstractView.extend({ } }); + _.each(measureString, function (string, name) { + if (measures[name]) { + measures[name].string = string; + } + }); + this.controllerParams.measures = measures; this.controllerParams.groupableFields = groupableFields; this.rendererParams.fields = this.fields; |
