Commit 66749291 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_core: keep current transformation if ME is already generated

parent 27a83f00
......@@ -223,7 +223,10 @@ class CompositionMixin:
portal_type=specialise_type_list or ())
effective_index += 1
for model in model_list:
model = _getEffectiveModel(model, start_date, stop_date)
if not self.Base_keepCurrentModel(model):
model = _getEffectiveModel(model, start_date, stop_date)
if model not in effective_set:
effective_set.add(model)
if 1: #model.test(self): # XXX
......
if current_model.getPortalType() == 'Transformation':
if context.getPortalType() == 'Simulation Movement':
delivery = context.getDeliveryValue(portal_type='Manufacturing Order Line')
if delivery:
applied_rule = context.objectValues(portal_type='Applied Rule')
if applied_rule:
sm = applied_rule[0].objectValues(portal_type='Simulation Movement')
if sm:
if sm[0].getDeliveryValue(portal_type='Manufacturing Execution Line'):
return True
return False
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>current_model, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_keepCurrentModel</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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