Issue 9630

client actions results in unloaded depends on the client side
Nosy list
ced, nicoe, reviewbot
Assigned to

Created on 2020-09-23.18:47:43 by nicoe, last changed 2 weeks ago by reviewbot.


Author: [hidden] (nicoe) Tryton committer
Date: 2020-09-23.19:11:59
I don't think it's required to load the depends of the depends because those fields are used to evaluate the states of a field so only their value is important not the state in which they are.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2020-09-23.19:04:26
I guess you mean on Form.display to add to the fields loaded the depends of those fields?
But then should it not be required to also load the depends of the depends etc.
Author: [hidden] (nicoe) Tryton committer
Date: 2020-09-23.18:47:43
This a bit convoluted to reproduce so I'll give a small example.

Let's consider a simple model:

class A:
  a = fields.Char('a', depends=['b'])
  b = fields.Char('b', depends=['c'])
  c = fields.Char('c')

Let's say the first form view of A consists of only displaying "a" and the second consists of displaying both "a" and "b".

If a button in the first form view will trigger a switch to the second view then the value of "c" will stay unset. Which could be an issue if the visibility of "b" depends on it.

What happens is that the first view is loaded and the fields_view_get returns only the fields "a" and "b", they are both loaded. When the second view is loaded "c" is added to the group but since only "a" and "b" have a widget the display on the form will load them and since they are already loaded no RPC call will happen.

I think the way to solve this is to add the depends of the fields with a widget when displaying a form.
Date User Action Args
2021-01-07 11:26:53reviewbotsetmessages: + msg63798
2020-10-26 10:25:59reviewbotsetmessages: + msg61410
2020-10-22 00:04:47cedsetstatus: chatting -> testing
2020-10-09 18:57:06reviewbotsetmessages: + msg60714
2020-10-06 01:27:26reviewbotsetmessages: + msg60597
2020-10-05 14:28:46reviewbotsetmessages: + msg60583
2020-09-25 14:24:14reviewbotsetmessages: + msg60376
2020-09-25 11:22:38reviewbotsetmessages: + msg60373
2020-09-24 15:13:33reviewbotsetnosy: + reviewbot
messages: + msg60310
2020-09-24 15:13:32reviewbotsetreviews: 298641002
keyword: + review

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