Michael Brown 1b3d60d961 [FIX] product: speed up product.template bulk record creation
Bulk inserts of product definitions (e.g. via a CSV import) will
suffer from an O(n^2) performance penalty due to an unfortunate cache
invalidation bug.  The underlying cause is difficult to determine due
to the labyrinthine nature of the relationship between product.product
and product.template, but some key elements are:

- The "product_variant_count" field is a non-stored computed field,
  and so gets invalidated by the call to recs.modified(upd_todo) in
  BaseModel.create()

- Field.determine_value() will call _prefetch_field() to repopulate
  "product_variant_count" by refetching all records from the database,
  despite the fact that "product_variant_count" is not stored in the
  database.

Using the length of "product_variant_ids" directly (instead of going
via "product_variant_count") seems to avoid this problem, possibly
because the definition of "product_variant_ids" conveys more
information about the circumstances in which its value must be
invalidated.

An alternative solution of making product_variant_count a stored field
(using the same trigger as for other variant-derived fields such as
volume and weight) works but still results in some unnecessary fetches
and invalidations.

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

Closes #13689
2016-10-06 13:02:52 +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%