2679fdd9b9740db27df87bd38817ad839f4778a9
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.
…
…
…
…
…
…
…
…
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
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%