Michael Brown d477dcc316 [FIX] models: fix behaviour of 'defer_parent_store_computation'
If a model uses nested sets to maintain a hierarchical record
ordering, then bulk inserts (e.g. via a CSV import) are likely to
suffer from an O(n^2) performance penalty, since there is a high
chance that each new record will require many of the existing records'
parent_left and parent_right fields to be updated.

The context parameter 'defer_parent_store_computation' may be passed
to the load() method, in order to defer updating the parent_left and
parent_right fields until after the bulk operation is complete.  This
appears to have last been fully supported in version 7 (via the old
import_data() method).

It is still possible to specify 'defer_parent_store_computation',
e.g. via an XML-RPC call such as

  m.execute_kw(dbname, uid, password, 'stock.location', 'load', [],
               {'fields': fields, 'data': data,
                'context': {'defer_parent_store_computation': True}})

This will currently defer the recalculation of parent_left and
parent_right, but does not correctly call _parent_store_compute()
after the bulk operation is complete.

Add the missing call to _parent_store_compute() to perform a one-time
update of the parent_left and parent_right fields if needed after the
import operation is complete.

Also fix the child_of_domain() and parent_of_domain() expression
methods, so that the 'child_of' and 'parent_of' operators give correct
answers when updates to parent_left and parent_right have been
deferred.

Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>

Closes #13688 (part 2/2)
2016-10-06 17:52:03 +02:00
2016-09-22 15:42:02 +02:00
2016-09-27 08:57:57 +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, 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/9.0/odoo.py | python

Then follow the developer tutorials

For Odoo employees

To add the odoo-dev remote use this command:

$ ./odoo.py setup_git_dev

To fetch odoo merge pull requests refs use this command:

$ ./odoo.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%