Vidhin Mehta  (OpenERP) has proposed merging 
lp:~openerp-dev/openerp-web/trunk-bug-928123-vme into lp:openerp-web.

Requested reviews:
  OpenERP R&D Web Team (openerp-dev-web)
Related bugs:
  Bug #928123 in OpenERP Web: "Graph error in purchase dashboard on empty 
database"
  https://bugs.launchpad.net/openerp-web/+bug/928123

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-bug-928123-vme/+merge/92473

Check condition if results are blank,then create empty graph.
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-bug-928123-vme/+merge/92473
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/trunk-bug-928123-vme.
=== modified file 'addons/web_graph/static/lib/dhtmlxGraph/codebase/dhtmlxchart.js'
--- addons/web_graph/static/lib/dhtmlxGraph/codebase/dhtmlxchart.js	2012-02-01 09:02:21 +0000
+++ addons/web_graph/static/lib/dhtmlxGraph/codebase/dhtmlxchart.js	2012-02-10 13:59:11 +0000
@@ -647,7 +647,6 @@
                     if (i.fixNum) n = parseFloat((new Number(n)).toFixed(i.fixNum));
                     var o = Math.floor(k + l * m) + 0.5;
                     n != e && j.lines && this.i(a, o, b, o, c.y, this.e.xAxis.color, 0.2);
-                    console.log("111111111111");
                     this.renderTextAt(false, true, o, b + 2, j.template(n.toString()), "dhx_axis_item_x");
                     l++
                 }

=== modified file 'addons/web_graph/static/src/js/graph.js'
--- addons/web_graph/static/src/js/graph.js	2012-02-01 09:02:21 +0000
+++ addons/web_graph/static/src/js/graph.js	2012-02-10 13:59:11 +0000
@@ -183,7 +183,7 @@
         var self = this;
         var group_list,
         view_chart = (self.chart == 'line')?'line':(self.chart == 'area')?'area':'';
-        if (!this.group_field) {
+        if (!this.group_field || !results.length) {
             if (self.chart == 'bar'){
                 view_chart = (this.orientation === 'horizontal') ? 'barH' : 'bar';
             }

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to