[FIX] removes non stored fields from measures
authorGéry Debongnie <ged@odoo.com>
Fri, 13 Jun 2014 11:32:24 +0000 (13:32 +0200)
committerGéry Debongnie <ged@odoo.com>
Fri, 13 Jun 2014 11:32:24 +0000 (13:32 +0200)
Non stored functional fields cannot be grouped by read_group, so it is
useless, and even harmful, to display them in the measure list (in
graph view).

addons/web_graph/static/src/js/graph_widget.js

index bbf27da..59f0af9 100644 (file)
@@ -114,7 +114,9 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({
     // Extracts the integer/float fields which are not 'id'
     get_measures: function() {
         return _.compact(_.map(this.fields, function (f, id) {
-            if (((f.type === 'integer') || (f.type === 'float')) && (id !== 'id')) {
+            if (((f.type === 'integer') || (f.type === 'float')) && 
+                (id !== 'id') &&
+                (f.store !== false)) {
                 return {field:id, type: f.type, string: f.string};
             }
         }));