From f8b7d96e20a2a89d31d3d7e4e90e5a30920131ab Mon Sep 17 00:00:00 2001 From: kmo Date: Wed, 21 Sep 2011 17:07:43 +0530 Subject: [PATCH 1/3] [FIX]Remove Overlapping of graph in Dashboard. lp bug: https://launchpad.net/bugs/854692 fixed bzr revid: kgo@kgo-desktop-20110921113743-0p19ocxmf26n2jtl --- addons/web_graph/static/src/js/graph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index 2a493b89166..3ab6d4e20fc 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -49,7 +49,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ this.operator = []; this.group_field = []; this.orientation = this.fields_view.arch.attrs.orientation || ''; - this.elem_id = this.$element[0]['id']; + this.elem_id = this.view_manager.element_id; _.each(this.fields_view.arch.children, function (field) { if (field.attrs.operator) { From 9adf06ef6f96acb7bac5ca3c3582c41b666d69ad Mon Sep 17 00:00:00 2001 From: Khushbu Date: Fri, 23 Sep 2011 14:25:57 +0530 Subject: [PATCH 2/3] [FIX] Used views own element id. bzr revid: kmo@tinyerp.com-20110923085557-t6alqpum8aa5ic4i --- addons/web_graph/static/src/js/graph.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index 3ab6d4e20fc..3052a7bb8c9 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -49,8 +49,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ this.operator = []; this.group_field = []; this.orientation = this.fields_view.arch.attrs.orientation || ''; - this.elem_id = this.view_manager.element_id; - + this.elem_id = this.element_id; _.each(this.fields_view.arch.children, function (field) { if (field.attrs.operator) { this.operator.push(field.attrs.name); From 895c2ab980b71f7a0f8785c67a4e3e846525ea71 Mon Sep 17 00:00:00 2001 From: Khushbu Date: Fri, 23 Sep 2011 15:07:53 +0530 Subject: [PATCH 3/3] [FIX] direct use of element_id bzr revid: kmo@tinyerp.com-20110923093753-8ghoyq5y24imet7y --- addons/web_graph/static/src/js/graph.js | 9 ++++----- addons/web_graph/static/src/xml/web_graph.xml | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index 3052a7bb8c9..86c37b5508a 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -49,7 +49,6 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ this.operator = []; this.group_field = []; this.orientation = this.fields_view.arch.attrs.orientation || ''; - this.elem_id = this.element_id; _.each(this.fields_view.arch.children, function (field) { if (field.attrs.operator) { this.operator.push(field.attrs.name); @@ -97,7 +96,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ }, schedule_chart: function(results) { - this.$element.html(QWeb.render("GraphView", {"fields_view": this.fields_view, "chart": this.chart,'elem_id': this.elem_id})); + this.$element.html(QWeb.render("GraphView", {"fields_view": this.fields_view, "chart": this.chart,'element_id': this.element_id})); _.each(results, function (result) { _.each(result, function (field_value, field_name) { @@ -303,7 +302,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ var bar_chart = new dhtmlXChart({ view: view_chart, - container: self.elem_id+"-barchart", + container: self.element_id+"-barchart", value:"#"+group_list[0]+"#", gradient: "3d", border: false, @@ -373,7 +372,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ }); } bar_chart.parse(_.values(abscissa_data), "json"); - jQuery("#"+self.elem_id+"-barchart").height(jQuery("#"+self.elem_id+"-barchart").height()+50); + jQuery("#"+self.element_id+"-barchart").height(jQuery("#"+self.element_id+"-barchart").height()+50); bar_chart.attachEvent("onItemClick", function(id) { self.open_list_view(bar_chart.get(id)); }); @@ -382,7 +381,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ var self = this; var chart = new dhtmlXChart({ view:"pie3D", - container:self.elem_id+"-piechart", + container:self.element_id+"-piechart", value:"#"+self.operator_field+"#", pieInnerText:function(obj) { var sum = chart.sum("#"+self.operator_field+"#"); diff --git a/addons/web_graph/static/src/xml/web_graph.xml b/addons/web_graph/static/src/xml/web_graph.xml index 4320b9f156e..90349623946 100644 --- a/addons/web_graph/static/src/xml/web_graph.xml +++ b/addons/web_graph/static/src/xml/web_graph.xml @@ -1,4 +1,4 @@ \ No newline at end of file