Commit 772d49e9 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

builder: Update Immediate Reindex Method

parent e29fb899
......@@ -35,9 +35,11 @@ from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Type.Core.Predicate import Predicate
from Products.ERP5.Document.Amount import Amount
from Products.ERP5.MovementGroup import MovementGroupNode
from Products.ERP5Type.ImmediateReindexContextManager import ImmediateReindexContextManager
from Products.ERP5Type.TransactionalVariable import getTransactionalVariable
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
from Products.ERP5.ExplanationCache import _getExplanationCache
from DateTime import DateTime
from Acquisition import aq_parent, aq_inner
......@@ -780,10 +782,8 @@ class BuilderMixin(XMLObject, Amount, Predicate):
self._setUpdated(delivery, 'delivery')
if property_dict:
property_dict.setdefault('edit_order', ('stop_date', 'start_date'))
delivery._edit(reindex_object=1, **property_dict)
if created:
delivery.immediateReindexObject()
with ImmediateReindexContextManager() as immediate_reindex_context_manager:
delivery._edit(immediate_reindex=immediate_reindex_context_manager, **property_dict)
# Then, create delivery line
for grouped_node in movement_group_node.getGroupList():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment