diff options
| author | Gery Debongnie <ged@openerp.com> | 2013-12-19 09:03:39 +0100 |
|---|---|---|
| committer | Gery Debongnie <ged@openerp.com> | 2013-12-19 09:03:39 +0100 |
| commit | 007dfea7022ace13c2bb90593ea980e393b4401f (patch) | |
| tree | f47b3804345bbe7362b4083d25020ff1bcf8bb02 /addons/web_graph/static/src | |
| parent | d7fdeec72fca399dfc28687d78e28bf5793d501e (diff) | |
[REF] small refactoring, it simplify the make_cells method in pivot.js (addon web_graph)
bzr revid: ged@openerp.com-20131219080339-7aqnuibtfk1y71a3
Diffstat (limited to 'addons/web_graph/static/src')
| -rw-r--r-- | addons/web_graph/static/src/js/pivot.js | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/addons/web_graph/static/src/js/pivot.js b/addons/web_graph/static/src/js/pivot.js index a38ee51bc78..04f82492d18 100644 --- a/addons/web_graph/static/src/js/pivot.js +++ b/addons/web_graph/static/src/js/pivot.js @@ -495,24 +495,12 @@ openerp.web_graph.DataLoader = openerp.web.Class.extend({ var attr = group.attributes, group_val = (attr.value instanceof Array) ? attr.value[1] : attr.value, path = current_path, - value; + value = (measure) ? attr.aggregates[measure] : attr.length; - if (group_val === false) { - group_val = undefined; - } - - if (measure) { - value = attr.aggregates[measure]; - } else { - value = attr.length; - } + group_val = (group_val === false) ? undefined : group_val; if (attr.grouped_on !== undefined) { - if (attr.value === false) { - path = path.concat('undefined'); - } else { - path = path.concat(group_val); - } + path = path.concat((attr.value === false) ? 'undefined' : group_val); } var rowpath = path.slice(0, index), |
