Issue 9930

Title
Setting the value of an unloaded field in a O2M on_change() call the lines added are added twice.
Priority
bug
Status
resolved
Nosy list
nicoe, reviewbot, roundup-bot
Assigned to
nicoe
Keywords
review

Created on 2020-12-09.18:59:58 by nicoe, last changed 9 months ago by roundup-bot.

Messages

New changeset fbd06865965b by Nicolas Évrard in branch '5.8':
Set loaded fields first after O2M on_change calls
https://hg.tryton.org/tryton/rev/fbd06865965b

New changeset 53774043c622 by Nicolas Évrard in branch '5.6':
Set loaded fields first after O2M on_change calls
https://hg.tryton.org/tryton/rev/53774043c622
New changeset 660c38b94d52 by Nicolas Évrard in branch '5.8':
Set loaded fields first after O2M on_change calls
https://hg.tryton.org/sao/rev/660c38b94d52

New changeset 2b26d52977fc by Nicolas Évrard in branch '5.6':
Set loaded fields first after O2M on_change calls
https://hg.tryton.org/sao/rev/2b26d52977fc
New changeset 771329da6d98 by Nicolas Évrard in branch 'default':
Set loaded fields first after O2M on_change calls
https://hg.tryton.org/tryton-env/rev/771329da6d98
New changeset 65002d9965d4 by Nicolas Évrard in branch 'default':
Set loaded fields first after O2M on_change calls
https://hg.tryton.org/tryton/rev/65002d9965d4
New changeset 10156791f1ed by Nicolas Évrard in branch 'default':
Set loaded fields first after O2M on_change calls
https://hg.tryton.org/sao/rev/10156791f1ed
Author: [hidden] (nicoe) Tryton committer
Date: 2020-12-09.18:59:57

This happens because the client fetches the new field definition which will trigger a default_get() call which if it sets the value of the field will also trigger the on_change() of the parent.

Thus the on_change() is called twice and the added lines are added twice.

History
Date User Action Args
2021-02-11 21:59:08roundup-botsetmessages: + msg64483
2021-02-11 21:58:51roundup-botsetkeyword: - backport
messages: + msg64479
2021-02-04 18:05:35roundup-botsetmessages: + msg64307
2021-02-04 18:05:34roundup-botsetmessages: + msg64306
2021-02-04 18:05:33roundup-botsetmessages: + msg64305
nosy: + roundup-bot
status: chatting -> resolved
2021-02-02 22:38:21cedsetkeyword: + backport
2021-01-28 18:24:06reviewbotsetmessages: + msg64146
2021-01-15 18:29:15reviewbotsetmessages: + msg63895
2020-12-11 11:31:54reviewbotsetmessages: + msg62709
nosy: + reviewbot
status: unread -> chatting
2020-12-09 19:00:19nicoesettitle: Setting the value of an unloaded field in a O2M `on_change()` call the lines added are added twice. -> Setting the value of an unloaded field in a O2M on_change() call the lines added are added twice.

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