qsm-odoo ef52914ea2 [REF] web: properly confirm value change of debounced input field
Input fields notify their changes when the user is typing text at a
rate of max 1 per second (by default) and when a change is confirmed.
This last case was handled by listening to the "focusout" event. The
"change" event is however more suited to handle that.

This commit also solves a problem with the related test. Before this
commit, the test triggered some "input" events on an <input/>, then
waited some time so that the debounced action is executed, then
restarted triggering events... the problem is that this "some time" was
long enough to trigger the onchange but not necessarily long enough
to be sure another onchange can be started. Indeed, the mockserver get
rid of RPC delays but not of CPU delay. As two subsequent onchange
cannot be done at the same time (the second one is done after the first
one is finished (see Mutex)) and that this test simulates a 3ms delay
for the onchange, there is no guarantee that waiting x ms (even > 3ms)
will be enough, indeed sometimes we had this sequence:

1) trigger "input" event
2) trigger "input" event
3) start delay of 75ms
4) debouncing time (3ms) is finished: call `_setValue`
5) basic model mutex (already resolved)
6) start async onchange RPC
7) (1) -> (6) took more than 75ms CPU time, the delay started in (3)
   is finished: trigger "change" event
8) call `_setValue` (no debouncing of "change" events)
9) basic model mutex... NOT resolved as the async onchange RPC
   started in (6) did not had the opportunity to continue its
   call sequence (no matter the time it would take)

To solve this problem, the 75ms delay had to be replaced by a non
arbitrary waiting: the mutex resolution. As the test does not know
about this mutex, the only way to be sure it is finished is to wait
for the `mockRPC` to be finished thanks to a deferred and then wait
for another callstack to be completed thanks to a 0ms delay.
2017-04-11 19:44:38 +02:00
2017-04-11 19:44:38 +02:00
2017-04-11 19:44:38 +02:00
2017-04-11 19:44:38 +02:00
2015-09-08 15:45:09 +02:00
2015-09-08 17:58:38 +02:00
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

If you are a developer you may type the following command at your terminal:

wget -O- https://raw.githubusercontent.com/odoo/odoo/master/setup/setup_dev.py | python

Then follow the developer tutorials

For Odoo employees

To add the odoo-dev remote use this command:

$ ./setup/setup_dev.py setup_git_dev

To fetch odoo merge pull requests refs use this command:

$ ./setup/setup_dev.py setup_git_review
S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%