changeset 7238bab22917 in tryton:5.2
details: https://hg.tryton.org/tryton?cmd=changeset;node=7238bab22917
description:
Do not use record in __init__ of form widget
During the initialization of the widget, the view may not yet have a
proper
record. But update_img access the record of the view.
Also it is safer for list-form to define the _record before calling
super in
case there is an access to record attribute.
issue8616
review285981002
(grafted from 032754bdac9d67ad96ecbf17d3732edf3c2399af)
diffstat:
tryton/gui/window/view_form/view/form_gtk/image.py | 2 --
tryton/gui/window/view_form/view/list_form.py | 2 +-
2 files changed, 1 insertions(+), 3 deletions(-)
diffs (25 lines):
diff -r d56be377daca -r 7238bab22917
tryton/gui/window/view_form/view/form_gtk/image.py
--- a/tryton/gui/window/view_form/view/form_gtk/image.py Sun Oct 06
13:49:25 2019 +0200
+++ b/tryton/gui/window/view_form/view/form_gtk/image.py Sat Sep 28
23:23:01 2019 +0200
@@ -44,8 +44,6 @@
self._readonly = False
- self.update_img()
-
@property
def filters(self):
filters = super(Image, self).filters
diff -r d56be377daca -r 7238bab22917
tryton/gui/window/view_form/view/list_form.py
--- a/tryton/gui/window/view_form/view/list_form.py Sun Oct 06 13:49:25
2019 +0200
+++ b/tryton/gui/window/view_form/view/list_form.py Sat Sep 28 23:23:01
2019 +0200
@@ -10,8 +10,8 @@
class ListBoxViewForm(ViewForm):
def __init__(self, view_id, screen, xml):
+ self._record = None
super().__init__(view_id, screen, xml)
- self._record = None
self.scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER)
@property