Tryton - Issues

 

Issue8450

Title fields.depends calculation error when parent and many2many
Priority bug Status testing
Superseder Nosy List ced, perilla, reviewbot
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 reviewbot.

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
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-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
2019-06-24 22:08:54perillacreate