Issue 10485

Title
Character entries of Dict widget are considered modified when their value is None
Priority
bug
Status
resolved
Nosy list
ced, nicoe, reviewbot, roundup-bot
Assigned to
nicoe
Keywords
review

Created on 2021-06-03.19:34:12 by nicoe, last changed 3 days ago by roundup-bot.

Messages

New changeset c9801dd3dab6 by Nicolas Évrard in branch 'default':
Consider Dict Char entries set to None as set to ""
https://hg.tryton.org/tryton-env/rev/c9801dd3dab6
New changeset 456afb21b221 by Nicolas Évrard in branch 'default':
Consider Dict Char entries set to None as set to ""
https://hg.tryton.org/tryton/rev/456afb21b221
New changeset fb81af61fc6c by Nicolas Évrard in branch 'default':
Consider Dict Char entries set to None as set to ""
https://hg.tryton.org/sao/rev/fb81af61fc6c
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-09-10.19:20:50

But it could be good to put some safegard in the client even if it should not happen.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-06-09.08:43:10

I do not agree with the observation. A dict key with a value equals to None is removed from the dict.
So the client should not behave like if it was an empty string. At best the clients could ignore such key when displaying the Dict but the problem is mainly in the code that set a key value to None.

Author: [hidden] (nicoe) Tryton committer
Date: 2021-06-03.19:34:12

Contrary to usual Character widgets the widgets used in the Dictionary are considered modified if their value is None.

In fact what happens is that there is no validation of the value of the dict, so if some code set a char value to None. The widget will be considered modified while it wasn't in any way. This does not happen for usual fields.Char because tryton will convert None to "" during the read.

We should probably unify the behaviour which is the goal of the attached review.

History
Date User Action Args
2021-09-21 16:00:27roundup-botsetmessages: + msg70251
2021-09-21 16:00:22roundup-botsetmessages: + msg70250
2021-09-21 16:00:20roundup-botsetmessages: + msg70249
nosy: + roundup-bot
status: in-progress -> resolved
2021-09-10 19:20:50cedsetmessages: + msg69995
2021-06-09 08:43:10cedsetmessages: + msg68155
nosy: + ced
2021-06-03 19:54:34reviewbotsetmessages: + msg67945
nosy: + reviewbot
2021-06-03 19:34:12nicoecreate

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