Commit 14d7f9b1 authored by Łukasz Nowak's avatar Łukasz Nowak

Migrate deliveries.

parent 25a83c66
......@@ -234,3 +234,10 @@ def SlapDocument_migrateSlapState(self):
if not(slap_document.getValidationState() == 'validated'):
raise ValueError('%s != %s' % (slap_document.getValidationState(), 'validated'))
def SalePackingListLine_deliver(self):
portal = self.getPortalObject()
assert(self.getResource() in [portal.portal_preferences.getPreferredInstanceSetupResource(),
portal.portal_preferences.getPreferredInstanceUpdateResource()])
if self.getSimulationState() != 'delivered':
portal.portal_workflow._jumpToStateFor(self.getParentValue(), 'delivered')
self.recursiveReindexObject()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<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>_body</string> </key>
<value> <string>context.portal_catalog.searchAndActivate(\n
portal_type=\'Sale Packing List Line\',\n
simulation_state=\'!= delivered\',\n
default_resource_uid=[context.restrictedTraverse(context.portal_preferences.getPreferredInstanceSetupResource()).getUid(),\n
context.restrictedTraverse(context.portal_preferences.getPreferredInstanceUpdateResource()).getUid()],\n
method_id=\'SalePackingListLine_deliver\'\n
)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_deliverSetupUpdateDelivery</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>SalePackingListLine_deliver</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>VifibUpgrader</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SalePackingListLine_deliver</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
102
\ No newline at end of file
103
\ No newline at end of file
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