-
- Downloads
[FIX] web: search in a m2o block the ui
Before this commit, performing a search in a m2o can block your ui
despite the result already being displayed.
Why?
When you perform your search in a m2o, a set of RPC queries are made
with the different search values (name_search). If the last search value
(the one that will be used by the m2o in its autocomplete) has already
been resolved, but one of the other RPCs has still not been resolved,
then the screen will remain blocked until all the rpc's have been resolved.
Solution:
Since we are only interested in the last rpc, we will cancel all the
others. So with each new rpc, we will cancel the previous one.
How to reproduce:
- Go to a form view with a m2o field
- Edit this field +- slowly (several rpc will be done with different values)
- Receive the result of the search. (The autocomplete is displayed with
the right values)
Before this commit:
If one of the other rpc's is not yet resolved, the ui will block
until all rpc's are resolved.
After this commit:
The ui will not block.
closes odoo/odoo#104411
Signed-off-by:
Samuel Degueldre <sad@odoo.com>
Showing
- addons/web/static/src/core/network/rpc_service.js 11 additions, 2 deletionsaddons/web/static/src/core/network/rpc_service.js
- addons/web/static/src/core/utils/hooks.js 11 additions, 5 deletionsaddons/web/static/src/core/utils/hooks.js
- addons/web/static/src/views/fields/relational_utils.js 5 additions, 1 deletionaddons/web/static/src/views/fields/relational_utils.js
- addons/web/static/tests/core/network/rpc_service_tests.js 7 additions, 0 deletionsaddons/web/static/tests/core/network/rpc_service_tests.js
- addons/web/static/tests/helpers/mock_services.js 5 additions, 2 deletionsaddons/web/static/tests/helpers/mock_services.js
Loading
Please register or sign in to comment