Tryton - Issues



Title Rationalize context usage in client
Priority feature Status resolved
Superseder Nosy List ced, pokoli, reviewbot, roundup-bot
Type feature request Components sao, tryton
Assigned To ced Keywords review
Reviews 40981002,43041002,44741002
View: 40981002, 43041002, 44741002

Created on 2018-01-20.20:10:37 by ced, last changed by roundup-bot.

New changeset 21a4c2280183 by Cédric Krier in branch 'default':
Use group context to retrieve the TimeDelta converter
review44741002 updated at
msg38965 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-03-13.13:59:11
It should be fixed with review44741002
msg38964 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-03-13.12:51:31
I reopen it because it broke the timedelta field. When opening the product form I get the following traceback:

ERROR:tryton.common.common:Traceback (most recent call last):
  File "/home/sergi/projectes/nclone/tryton/tryton/gui/window/", line 298, in sig_new
  File "/home/sergi/projectes/nclone/tryton/tryton/gui/window/view_form/screen/", line 548, in new
  File "/home/sergi/projectes/nclone/tryton/tryton/gui/window/view_form/screen/", line 488, in switch_view
  File "/home/sergi/projectes/nclone/tryton/tryton/gui/window/view_form/screen/", line 858, in display
  File "/home/sergi/projectes/nclone/tryton/tryton/gui/window/view_form/view/", line 518, in display
    widget.display(record, field)
  File "/home/sergi/projectes/nclone/tryton/tryton/gui/window/view_form/view/form_gtk/", line 44, in display
    value = field.get_client(record)
  File "/home/sergi/projectes/nclone/tryton/tryton/gui/window/view_form/model/", line 287, in get_client
    return common.timedelta.format(value, self.converter(
  File "/home/sergi/projectes/nclone/tryton/tryton/gui/window/view_form/model/", line 277, in converter
    return self.get_context().get(self.attrs.get('converter'))
TypeError: get_context() takes exactly 2 arguments (1 given)
New changeset 4392ca20106e by Cédric Krier in branch 'default':
Rationalize context usage
New changeset 4c80f5b14952 by Cédric Krier in branch 'default':
Rationalize context usage
review40981002 updated at
review43041002 updated at
review40981002 updated at
review43041002 updated at
review43041002 updated at
review40981002 updated at
msg37703 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-01-20.20:10:36
The construction of the context inside the client is not rationalized. Sometimes, we add the rpc.CONTEXT, we use the screen static context (in sao) or we update multiple times the parent context etc.
I think we should rationalize by always use the context of the group as reference and to always add the rpc context.
Also the expr_eval uses the context as base which is mixed with the fields. Instead we should enforce to always use explicitly the 'context' keyword. And the '_user' key is added which does not seem to be used anywhere, so it could be removed. If someone need it, he could add to the user context.
Date User Action Args
2018-03-14 00:08:26roundup-botsetstatus: testing -> resolved
messages: + msg38979
2018-03-13 14:13:09reviewbotsetmessages: + msg38970
2018-03-13 13:59:11cedsetstatus: in-progress -> testing
reviews: 40981002,43041002 -> 40981002,43041002,44741002
messages: + msg38965
2018-03-13 12:51:31pokolisetstatus: resolved -> in-progress
nosy: + pokoli
messages: + msg38964
2018-03-09 19:11:13roundup-botsetmessages: + msg38914
2018-03-09 19:10:25roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg38913
2018-02-23 18:49:27reviewbotsetmessages: + msg38586
2018-02-23 18:49:23reviewbotsetmessages: + msg38585
2018-02-23 18:13:16cedlinkissue7157 superseder
2018-02-07 00:55:55reviewbotsetmessages: + msg38264

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