The use case is the following:
- Create a kanban view
- Customize it to open a form view on the right when clicking on a kanban card
- The form view is initialized using the context with a 'default_...' key to set a field.
=> Since the context is different every time, the 'load_views' rpc call is always triggered, leading to performance issues.
Task: 2555114
Part-of: odoo/odoo#91448
Now that pyEnv is available, using it in the mock_server lighten the syntax.
task-2582313
closesodoo/odoo#90783
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, the result of the load_views was put in the cache, so a load_views could have been
triggered multiple times before the first of them returned
After this commit, the cahce works as expected and stores the whole Promise
We always delete from the cache Promises that are rejected (to let the user re-do it in the hope the situatuion has changed)