Tryton - Issues

 

Issue7948

Title invalid (?) entry in timesheet_work causes gtk client to show traceback
Priority bug Status resolved
Superseder Nosy List ced, lordvan, reviewbot, roundup-bot
Type crash Components timesheet
Assigned To ced Keywords review
Reviews 52581002
View: 52581002

Created on 2018-12-27.14:59:43 by lordvan, last changed by roundup-bot.

Messages
New changeset 01c72a4f7cb5 by Cédric Krier in branch '5.0':
Test if origin is ModelStorage instance before calling rec_name
https://hg.tryton.org/modules/timesheet/rev/01c72a4f7cb5

New changeset 1d083ed343d0 by Cédric Krier in branch '4.8':
Test if origin is ModelStorage instance before calling rec_name
https://hg.tryton.org/modules/timesheet/rev/1d083ed343d0

New changeset d0bc1cb7d702 by Cédric Krier in branch '4.6':
Test if origin is ModelStorage instance before calling rec_name
https://hg.tryton.org/modules/timesheet/rev/d0bc1cb7d702

New changeset b4bbe422b1bc by Cédric Krier in branch '4.4':
Test if origin is ModelStorage instance before calling rec_name
https://hg.tryton.org/modules/timesheet/rev/b4bbe422b1bc

New changeset 8ef86cca35cc by Cédric Krier in branch '4.2':
Test if origin is ModelStorage instance before calling rec_name
https://hg.tryton.org/modules/timesheet/rev/8ef86cca35cc
New changeset 64d06dc2dc7c by Cédric Krier in branch 'default':
Test if origin is ModelStorage instance before calling rec_name
https://hg.tryton.org/tryton-env/rev/64d06dc2dc7c
New changeset 467f0f8755f0 by Cédric Krier in branch 'default':
Test if origin is ModelStorage instance before calling rec_name
https://hg.tryton.org/modules/timesheet/rev/467f0f8755f0
review52581002 updated at https://codereview.tryton.org/52581002/#ps1
msg45507 (view) Author: [hidden] (lordvan) Date: 2018-12-27.14:59:42
Trytond 5.0.2
timesheet-5.0.0

I somehow (UI or lag maybe?) managed to get these 2 entries in timesheet_work:
 id | name | write_date |        create_date         | company | timesheet_end_date |       origin       | timesheet_start_date | write_uid | active | create_uid
----+------+------------+----------------------------+---------+--------------------+--------------------+----------------------+-----------+--------+------------
  1 | IT   |            | 2018-12-27 13:29:21.411028 |       1 |                    | production.work,-1 |                      |           | t      |          1
  2 | IT   |            | 2018-12-27 13:29:48.623976 |       1 |                    |                    |                      |           | t      |          1

This causes the client to show a error & traceback . I don't have it anymore right now, but in the tryton log was this:

Traceback (most recent call last):
  File "/usr/lib64/python3.5/site-packages/trytond/protocols/dispatcher.py", line 176, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/usr/lib64/python3.5/site-packages/trytond/model/modelsql.py", line 826, in read
    getter_results = field.get(ids, cls, field_list, values=result)
  File "/usr/lib64/python3.5/site-packages/trytond/model/fields/function.py", line 103, in get
    return dict((name, call(name)) for name in names)
  File "/usr/lib64/python3.5/site-packages/trytond/model/fields/function.py", line 103, in <genexpr>
    return dict((name, call(name)) for name in names)
  File "/usr/lib64/python3.5/site-packages/trytond/model/fields/function.py", line 98, in call
    return dict((r.id, method(r, name)) for r in records)
  File "/usr/lib64/python3.5/site-packages/trytond/model/fields/function.py", line 98, in <genexpr>
    return dict((r.id, method(r, name)) for r in records)
  File "/usr/lib64/python3.5/site-packages/trytond/modules/timesheet/work.py", line 177, in get_rec_name
    return self.origin.rec_name
AttributeError: 'str' object has no attribute 'rec_name'


I don't know much about the timesheet module (yet) but it seems the data that was in the timesheet_work row id 1 caused it to have an error. removing that row fixed my issue.
History
Date User Action Args
2019-02-10 23:50:07roundup-botsetmessages: + msg46918
2019-01-15 00:04:18roundup-botsetmessages: + msg45963
2019-01-15 00:04:10roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg45962
2019-01-08 11:15:36reviewbotsetnosy: + reviewbot
messages: + msg45873
2019-01-08 10:49:55cedsetstatus: unread -> testing
reviews: 52581002
nosy: + ced
keyword: + review
assignedto: ced
2018-12-27 14:59:43lordvancreate