Tryton - Issues

 

Issue8450

Title fields.depends calculation error when parent and many2many
Priority bug Status resolved
Superseder Nosy List ced, perilla, reviewbot, roundup-bot
Type behavior Components proteus
Assigned To ced Keywords review
Reviews 264411005
View: 264411005

Created on 2019-06-24.22:08:54 by perilla, last changed by roundup-bot.

Files
File name Uploaded Type Edit Remove
DeepinScreenshot_Seleccionar área_20190624154253.png perilla, 2019-06-24.22:44:25 image/png
m2m_test.tar.gz perilla, 2019-06-24.22:08:53 application/gzip
Messages
New changeset 785226ceb80e by Cédric Krier in branch '5.2':
Ensure on_change arguments are loaded
https://hg.tryton.org/proteus/rev/785226ceb80e

New changeset 4d62738bef56 by Cédric Krier in branch '5.0':
Ensure on_change arguments are loaded
https://hg.tryton.org/proteus/rev/4d62738bef56

New changeset 23f15dcad254 by Cédric Krier in branch '4.8':
Ensure on_change arguments are loaded
https://hg.tryton.org/proteus/rev/23f15dcad254

New changeset 51e31eec316f by Cédric Krier in branch '4.6':
Ensure on_change arguments are loaded
https://hg.tryton.org/proteus/rev/51e31eec316f

New changeset 759f90e4b52b by Cédric Krier in branch '4.4':
Ensure on_change arguments are loaded
https://hg.tryton.org/proteus/rev/759f90e4b52b
New changeset 626ec502deb3 by Cédric Krier in branch 'default':
Ensure on_change arguments are loaded
https://hg.tryton.org/tryton-env/rev/626ec502deb3
New changeset 983a7c8286f1 by Cédric Krier in branch 'default':
Ensure on_change arguments are loaded
https://hg.tryton.org/proteus/rev/983a7c8286f1
review264411005 updated at https://codereview.tryton.org/264411005/#ps272281002
msg52431 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-10-11.23:46:49
Here is review264411005 which ensures the on_change arguments are loaded.
msg52423 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-10-11.19:23:44
Indeed the problem is not the depends but the behavior of proteus which sent an empty list for parties when calling on_change_with_allowed_parties.
This is mainly because after the save, the parent record is not fully read before adding the line. The scenario can be fixed by just adding after the save:

_ = model_a2.parties

But I think proteus could be fixed to be smarter and in such case not sent an empty list to let the server read the value from the database.
msg51455 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-08-24.08:53:25
What does it mean "trytond not detect parent data"?
Could you provide a clear scenario to reproduce the problem?
msg50374 (view) Author: [hidden] (perilla) Date: 2019-06-24.22:44:25
I debug code, and seems to be related with delete cache inside
__getattr__ on modelstorage
msg50373 (view) Author: [hidden] (perilla) Date: 2019-06-24.22:12:04
I forgot to say that I am using 5.0 version
msg50372 (view) Author: [hidden] (perilla) Date: 2019-06-24.22:08:53
When a model use a fields.depends of a parent field many2many,
trytond not detect parent data if I save parent record before
create new lines.

I attach a module sample, with scenario test
On this scenario if I delete line 53, test ends with ok
History
Date User Action Args
2019-10-30 23:59:38roundup-botsetmessages: + msg52815
keyword: - backport
2019-10-24 19:02:50roundup-botsetmessages: + msg52673
2019-10-24 19:02:45roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg52672
2019-10-24 19:01:33cedsetkeyword: + backport
2019-10-11 23:48:04reviewbotsetnosy: + reviewbot
messages: + msg52433
2019-10-11 23:46:49cedsetstatus: in-progress -> testing
reviews: 264411005
messages: + msg52431
keyword: + review
2019-10-11 19:23:45cedsetstatus: need-eg -> in-progress
assignedto: ced
component: + proteus, - trytond
messages: + msg52423
type: behavior
2019-08-24 08:53:26cedsetstatus: chatting -> need-eg
nosy: + ced
messages: + msg51455
2019-06-24 22:44:25perillasetfiles: + DeepinScreenshot_Seleccionar área_20190624154253.png
messages: + msg50374
2019-06-24 22:12:04perillasetstatus: unread -> chatting
messages: + msg50373

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