Commit 8d5acfa8 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

builder: immediate reindex delivery on creation

parent ae97add1
......@@ -640,6 +640,7 @@ class BuilderMixin(XMLObject, Amount, Predicate):
if force_update and delivery is None and len(delivery_to_update_list):
delivery = delivery_to_update_list[0]
created = False
if delivery is None:
if not self.isDeliveryCreatable():
raise SelectMethodError('No updatable delivery found with %s for %s' \
......@@ -648,11 +649,14 @@ class BuilderMixin(XMLObject, Amount, Predicate):
delivery = self._createDelivery(delivery_module,
movement_group_node.getMovementList(),
activate_kw)
created = True
# Put properties on delivery
self._setUpdated(delivery, 'delivery')
if property_dict:
property_dict.setdefault('edit_order', ('stop_date', 'start_date'))
delivery.edit(**property_dict)
if created:
delivery.immediateReindexObject()
# Then, create delivery line
......
......@@ -541,7 +541,10 @@ class SimulableMixin(Base):
if applied_rule is None:
applied_rule = self._createRootAppliedRule()
expand_root = applied_rule is not None
activate_kw = {'tag': 'build:'+self.getPath()}
activate_kw = {
'priority': 4,
'tag': 'build:'+self.getPath(),
}
if expand_root:
applied_rule.expand(activate_kw=activate_kw)
else:
......
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