Tryton - Issues

 

Issue8616

Title AttributeError: 'ListBoxViewForm' object has no attribute '_record'
Priority bug Status resolved
Superseder Nosy List ced, reviewbot, roundup-bot, smarro
Type crash Components tryton
Assigned To ced Keywords review
Reviews 285981002
View: 285981002

Created on 2019-08-28.01:39:29 by smarro, last changed by roundup-bot.

Messages
New changeset 119921ae2ec8 by Cédric Krier in branch '5.2':
Do not use record in __init__ of form widget
https://hg.tryton.org/sao/rev/119921ae2ec8
New changeset 85e2264d1da8 by Cédric Krier in branch 'default':
Do not use record in __init__ of form widget
https://hg.tryton.org/tryton-env/rev/85e2264d1da8
New changeset 032754bdac9d by Cédric Krier in branch 'default':
Do not use record in __init__ of form widget
https://hg.tryton.org/tryton/rev/032754bdac9d
New changeset 9953ba78be72 by Cédric Krier in branch 'default':
Do not use record in __init__ of form widget
https://hg.tryton.org/sao/rev/9953ba78be72
msg51997 (view) Author: [hidden] (smarro) Date: 2019-09-22.02:38:14
I confirm patch fix the problem
review285981002 updated at https://codereview.tryton.org/285981002/#ps249981002
msg51988 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-09-20.18:23:59
Here is review285981002 which should fix the problem.
msg51532 (view) Author: [hidden] (smarro) Date: 2019-08-28.01:39:28
Using Tryton 5.2

To reproduce the error, put a binary field with widget="image" in a view of type list-form

Removing line with
self.update_img()
from __init__ method of Image class, makes it no longer show the error


Traceback:
  File "/media/sebastian/SOURCE/workspace/tryton/5.2/venv/lib/python3.7/site-packages/tryton-5.2.5-py3.7.egg/tryton/gui/window/view_form/view/list_form.py", line 82, in _create_form
    view_form = ListBoxViewForm(self.view_id, self.screen, self.form_xml)
  File "/media/sebastian/SOURCE/workspace/tryton/5.2/venv/lib/python3.7/site-packages/tryton-5.2.5-py3.7.egg/tryton/gui/window/view_form/view/list_form.py", line 13, in __init__
    super().__init__(view_id, screen, xml)
  File "/media/sebastian/SOURCE/workspace/tryton/5.2/venv/lib/python3.7/site-packages/tryton-5.2.5-py3.7.egg/tryton/gui/window/view_form/view/form.py", line 416, in __init__
    super().__init__(view_id, screen, xml)
  File "/media/sebastian/SOURCE/workspace/tryton/5.2/venv/lib/python3.7/site-packages/tryton-5.2.5-py3.7.egg/tryton/gui/window/view_form/view/__init__.py", line 35, in __init__
    ).parse(xml)
  File "/media/sebastian/SOURCE/workspace/tryton/5.2/venv/lib/python3.7/site-packages/tryton-5.2.5-py3.7.egg/tryton/gui/window/view_form/view/__init__.py", line 130, in parse
    parser(node, node_attrs)
  File "/media/sebastian/SOURCE/workspace/tryton/5.2/venv/lib/python3.7/site-packages/tryton-5.2.5-py3.7.egg/tryton/gui/window/view_form/view/form.py", line 201, in _parse_form
    self.parse_child(node, container)
  File "/media/sebastian/SOURCE/workspace/tryton/5.2/venv/lib/python3.7/site-packages/tryton-5.2.5-py3.7.egg/tryton/gui/window/view_form/view/form.py", line 208, in parse_child
    self.parse(child)
  File "/media/sebastian/SOURCE/workspace/tryton/5.2/venv/lib/python3.7/site-packages/tryton-5.2.5-py3.7.egg/tryton/gui/window/view_form/view/__init__.py", line 130, in parse
    parser(node, node_attrs)
  File "/media/sebastian/SOURCE/workspace/tryton/5.2/venv/lib/python3.7/site-packages/tryton-5.2.5-py3.7.egg/tryton/gui/window/view_form/view/form.py", line 218, in _parse_field
    widget = self.WIDGETS[attributes['widget']](self.view, attributes)
  File "/media/sebastian/SOURCE/workspace/tryton/5.2/venv/lib/python3.7/site-packages/tryton-5.2.5-py3.7.egg/tryton/gui/window/view_form/view/form_gtk/image.py", line 47, in __init__
    self.update_img()
  File "/media/sebastian/SOURCE/workspace/tryton/5.2/venv/lib/python3.7/site-packages/tryton-5.2.5-py3.7.egg/tryton/gui/window/view_form/view/form_gtk/image.py", line 100, in update_img
    if self.field:
  File "/media/sebastian/SOURCE/workspace/tryton/5.2/venv/lib/python3.7/site-packages/tryton-5.2.5-py3.7.egg/tryton/gui/window/view_form/view/form_gtk/widget.py", line 45, in field
    if self.record:
  File "/media/sebastian/SOURCE/workspace/tryton/5.2/venv/lib/python3.7/site-packages/tryton-5.2.5-py3.7.egg/tryton/gui/window/view_form/view/form_gtk/widget.py", line 41, in record
    return self.view.record
  File "/media/sebastian/SOURCE/workspace/tryton/5.2/venv/lib/python3.7/site-packages/tryton-5.2.5-py3.7.egg/tryton/gui/window/view_form/view/list_form.py", line 19, in record
    return self._record

AttributeError: 'ListBoxViewForm' object has no attribute '_record'

Could not reproduce the error in sao
History
Date User Action Args
2019-10-23 00:58:35roundup-botsetmessages: + msg52634
keyword: - backport
2019-09-28 23:23:29roundup-botsetmessages: + msg52076
2019-09-28 23:23:28roundup-botsetmessages: + msg52075
2019-09-28 23:23:24roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg52074
2019-09-28 23:23:18cedsetkeyword: + backport
2019-09-22 02:38:15smarrosetmessages: + msg51997
2019-09-20 18:51:55reviewbotsetnosy: + reviewbot
messages: + msg51990
2019-09-20 18:23:59cedsetstatus: unread -> testing
keyword: + review
nosy: + ced
messages: + msg51988
reviews: 285981002
assignedto: ced
type: crash
2019-08-28 01:39:29smarrocreate

Showing 10 items. Show all history (warning: this could be VERY long)