Merge pull request #746 from acsone/master-defer_parent_store_computation-on-write

[IMP] orm: defer_parent_store_computation in write

Take into account the context parameter 'defer_parent_store_computation' in write operation.
When executing actions with this key in the context, _parent_store_compute should be manually called afterwards. Use at your own risks...
This commit is contained in:
Martin Trigaux 2014-06-24 15:13:24 +02:00
commit 6e91cb5f50
1 changed files with 1 additions and 1 deletions

View File

@ -3860,7 +3860,7 @@ class BaseModel(object):
parents_changed = []
parent_order = self._parent_order or self._order
if self._parent_store and (self._parent_name in vals):
if self._parent_store and (self._parent_name in vals) and not context.get('defer_parent_store_computation'):
# The parent_left/right computation may take up to
# 5 seconds. No need to recompute the values if the
# parent is the same.