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