From 007dfea7022ace13c2bb90593ea980e393b4401f Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Thu, 19 Dec 2013 09:03:39 +0100 Subject: [PATCH] [REF] small refactoring, it simplify the make_cells method in pivot.js (addon web_graph) bzr revid: ged@openerp.com-20131219080339-7aqnuibtfk1y71a3 --- addons/web_graph/static/src/js/pivot.js | 18 +++--------------- 1 file 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),