changeset d5db7810b548 in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset;node=d5db7810b548
description:
Support sparse data in y's graph with domain
The value when the domain skip the record should be undefined so the
graph has
no point at this ordinate.
issue10072
review337561002
diffstat:
tryton/gui/window/view_form/view/graph_gtk/graph.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diffs (19 lines):
diff -r 8044fd76d224 -r d5db7810b548
tryton/gui/window/view_form/view/graph_gtk/graph.py
--- a/tryton/gui/window/view_form/view/graph_gtk/graph.py Sun Feb 14
15:45:21 2021 +0100
+++ b/tryton/gui/window/view_form/view/graph_gtk/graph.py Tue Feb 16
22:38:16 2021 +0100
@@ -370,7 +370,6 @@
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 @@
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: