diff --git a/tryton/gui/window/view_form/view/graph_gtk/graph.py b/tryton/gui/window/view_form/view/graph_gtk/graph.py index a854d30ac3..370286739a 100644 --- a/tryton/gui/window/view_form/view/graph_gtk/graph.py +++ b/tryton/gui/window/view_form/view/graph_gtk/graph.py @@ -370,7 +370,6 @@ class Graph(Gtk.DrawingArea): self.datas.setdefault(x, {}) for yfield in self.yfields: key = yfield.get('key', yfield['name']) - self.datas[x].setdefault(key, 0.0) if yfield.get('domain'): context = rpc.CONTEXT.copy() context['context'] = context.copy() @@ -379,6 +378,7 @@ class Graph(Gtk.DrawingArea): context[field] = model[field].get(model) if not PYSONDecoder(context).decode(yfield['domain']): continue + self.datas[x].setdefault(key, 0.0) if yfield['name'] == '#': self.datas[x][key] += 1 else: