diff --git a/tryton/gui/window/view_form/view/graph_gtk/bar.py b/tryton/gui/window/view_form/view/graph_gtk/bar.py index 8abebb5bee..0d99af6557 100644 --- a/tryton/gui/window/view_form/view/graph_gtk/bar.py +++ b/tryton/gui/window/view_form/view/graph_gtk/bar.py @@ -65,6 +65,9 @@ class Bar(Graph): def motion(self, widget, event): super(Bar, self).motion(widget, event) + if not getattr(self, 'area', None): + return + def intersect(bar, event): x = self.area.w * bar.x + self.area.x y = self.area.h * bar.y + self.area.y diff --git a/tryton/gui/window/view_form/view/graph_gtk/line.py b/tryton/gui/window/view_form/view/graph_gtk/line.py index bd05f53bf9..13868f4323 100644 --- a/tryton/gui/window/view_form/view/graph_gtk/line.py +++ b/tryton/gui/window/view_form/view/graph_gtk/line.py @@ -154,6 +154,9 @@ class Line(Graph): cr.restore() def motion(self, widget, event): + if not getattr(self, 'area', None): + return + nearest = None for point in self.points: x = point.x * self.area.w + self.area.x diff --git a/tryton/gui/window/view_form/view/graph_gtk/pie.py b/tryton/gui/window/view_form/view/graph_gtk/pie.py index 174ebf547b..9018288c3d 100644 --- a/tryton/gui/window/view_form/view/graph_gtk/pie.py +++ b/tryton/gui/window/view_form/view/graph_gtk/pie.py @@ -108,6 +108,9 @@ class Pie(Graph): def motion(self, widget, event): super(Pie, self).motion(widget, event) + if not getattr(self, 'area', None): + return + d = (event.x - self.centerx) ** 2 + (event.y - self.centery) ** 2 if d > self.radius ** 2: self.popup.hide()