Géry Debongnie 2679fdd9b9 [FIX] web: add mutex in basic controller
Before this commit, concurrency issues were mostly handled by the mutex
in the basic model.  That mutex makes sure that save and change
operations are properly serialized.  However, this is not enough. Here
is an example:

1. we have a required field with an onchange and a current value
2. the user changes the value to an empty value. This triggers an
   onchange
3. the user clicks on save, before the return of the onchange
4. the controller checks with the renderer if it can be saved.  At that
   point, the onchange is not yet complete, so the values stored in the
   fields are still the initial ones, which are valid (non empty value
   for required fields)
5. so, the controller request a save operation
6. the model add the save operation in the mutex, wait for the onchange
   to complete, then apply the save operation
7. we end up with a required field with an empty value

The issue here is that the model properly saves and apply onchanges, but
the responsability to check if a record is valid (which depends on the
modifiers AND the field widgets) is the renderer's responsability (it
has to ask the question to all its sub field widgets).

So, we need to serialize 3 operations: applying the onchange, checking
if the save is valid, and saving the record.  This cannot be only in the
model, so we need to add a concurrency control mechanism somewhere else.
What we do in this commit is to add a mutex on the basic controller (it
will most likely be used by the list controller as well).  In this
mutex, we currently serialize the field change operation and the save
operation, but I assume some other operations will need to be handled by
the mutex.

In addition to this, we also change some asynchronous methods to return
a deferred, so we are ready for other kind of asynchronous behaviour in
the future.
2017-04-26 10:32:03 +02:00
2017-04-11 19:44:38 +02:00
2017-04-25 16:42:37 +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%