diff options
| author | Gery Debongnie <ged@openerp.com> | 2014-01-22 08:56:52 +0100 |
|---|---|---|
| committer | Gery Debongnie <ged@openerp.com> | 2014-01-22 08:56:52 +0100 |
| commit | d1e3504b8051a91ea85f5add314277caef6592d9 (patch) | |
| tree | 3bcb265d599f0a2e3e4c32e98eb09ba6d44934f2 /addons/web_graph/static/src/js | |
| parent | e131e873cabc2e44f91eef34f47f997c88d4ea78 (diff) | |
[IMP] two small tweaks to improve the code quality in addon web_graph
bzr revid: ged@openerp.com-20140122075652-wz2uk3tv31ady4ej
Diffstat (limited to 'addons/web_graph/static/src/js')
| -rw-r--r-- | addons/web_graph/static/src/js/graph_widget.js | 1 | ||||
| -rw-r--r-- | addons/web_graph/static/src/js/pivot_table.js | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/addons/web_graph/static/src/js/graph_widget.js b/addons/web_graph/static/src/js/graph_widget.js index 28a96ca7907..0b78468b0b4 100644 --- a/addons/web_graph/static/src/js/graph_widget.js +++ b/addons/web_graph/static/src/js/graph_widget.js @@ -43,7 +43,6 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({ return this.model.call('fields_get', []).then(function (f) { self.fields = f; - self.fields.__count = {string: 'Quantity', type: 'integer'}; self.measure_list = self.get_measures(); self.add_measures_to_options(); self.pivot_options.row_groupby = self.create_field_values(self.pivot_options.row_groupby || []); diff --git a/addons/web_graph/static/src/js/pivot_table.js b/addons/web_graph/static/src/js/pivot_table.js index 74197f3a984..5a2e93ecd7c 100644 --- a/addons/web_graph/static/src/js/pivot_table.js +++ b/addons/web_graph/static/src/js/pivot_table.js @@ -423,7 +423,7 @@ openerp.web_graph.PivotTable = openerp.web.Class.extend({ if (group.attributes.grouped_on && this.fields[group.attributes.grouped_on].type === 'selection') { var selection = this.fields[group.attributes.grouped_on].selection, - value_lookup = _.find(selection, function (val) { return val[0] === value; }); + value_lookup = _.where(selection, {0:value}); group.attributes.value = value_lookup ? value_lookup[1] : 'undefined'; } else if (value === false) { group.attributes.value = 'undefined'; |
