Commit 0b9e2051 authored by Julien Muchembled's avatar Julien Muchembled

Workflow histories are use less for many temporary objects

In the case of Base.asContext, initializing workflow was totally useless
because 'workflow_history' was overridden by the original one.
parent 29b4903b
......@@ -690,7 +690,8 @@ class BusinessProcess(Path, XMLObject):
if update_property_dict is None: update_property_dict = {}
for trade_model_path in self.getTradeModelPathValueList(context=amount, trade_phase=trade_phase):
id_index += 1
movement = newTempSimulationMovement(trade_model_path, '%s_%s' % (base_id, id_index))
movement = newTempSimulationMovement(trade_model_path,
'%s_%s' % (base_id, id_index), notify_workflow=False)
kw = self._getPropertyAndCategoryDict(explanation, amount, trade_model_path, delay_mode=delay_mode)
try:
kw['trade_phase'], = \
......
......@@ -98,8 +98,7 @@ class Order(Delivery):
return 0
current_aggregated_amount_list = trade_condition.getAggregatedAmountList(self, rounding=rounding, force_create_line=True)
trade_model_line = newTempTradeModelLine(
self,
'_temp_%s' % (self.getId()))
self, '_temp_' + self.getId(), notify_workflow=False)
# prevent invoking interaction workflows.
trade_model_line.portal_type = ''
trade_model_line.edit(target_level=TARGET_LEVEL_MOVEMENT, price=1,
......
......@@ -325,7 +325,8 @@ class AmountGeneratorMixin:
# Create an Amount object
amount = newTempAmount(portal,
# we only want the id to be unique so we pick a random causality
causality_value.getRelativeUrl().replace('/', '_'))
causality_value.getRelativeUrl().replace('/', '_'),
notify_workflow=False)
amount._setCategoryList(property_dict.pop('category_list', ()))
if amount.getQuantityUnit():
del property_dict['quantity_unit']
......
......@@ -2623,6 +2623,7 @@ class Base( CopyContainer,
container=self.getParentValue(),
id=self.getId(),
temp_object=True,
notify_workflow=False,
is_indexable=False)
# Pass all internal data to new instance. Do not copy, but
......
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