Commit b48e298a authored by Łukasz Nowak's avatar Łukasz Nowak

Use Person_updateOpenOrder script instead direct modification.

parent ba85984c
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>active_sense_method_id</string> </key> <key> <string>active_sense_method_id</string> </key>
<value> <string>Alarm_updateOpenSaleOrderLine</string> </value> <value> <string>Alarm_updateOpenSaleOrderStopDateOnLineList</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
......
...@@ -61,10 +61,11 @@ if stop_date is None:\n ...@@ -61,10 +61,11 @@ if stop_date is None:\n
stop_date = addToDate(getClosestDate(target_date=DateTime(), precision=\'month\', before=1), month=1)\n stop_date = addToDate(getClosestDate(target_date=DateTime(), precision=\'month\', before=1), month=1)\n
\n \n
context.portal_catalog.searchAndActivate(\n context.portal_catalog.searchAndActivate(\n
method_id=\'OpenSaleOrderLine_updateStopDate\',\n method_id=\'OpenSaleOrder_updateStopDate\',\n
activate_kw={\'tag\':tag},\n activate_kw={\'tag\':tag},\n
method_kw={\'stop_date\': stop_date},\n method_kw={\'stop_date\': stop_date},\n
portal_type=\'Open Sale Order Line\')\n portal_type=\'Open Sale Order\',\n
validation_state=\'validated\')\n
\n \n
context.activate(after_tag=tag).getId()\n context.activate(after_tag=tag).getId()\n
</string> </value> </string> </value>
...@@ -75,7 +76,7 @@ context.activate(after_tag=tag).getId()\n ...@@ -75,7 +76,7 @@ context.activate(after_tag=tag).getId()\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Alarm_updateOpenSaleOrderLine</string> </value> <value> <string>Alarm_updateOpenSaleOrderStopDateOnLineList</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -50,13 +50,8 @@ ...@@ -50,13 +50,8 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string>context.getDestinationDecisionValue().Person_updateOpenOrder(stop_date=stop_date)\n
</string> </value>
if context.getStopDate() < stop_date:\n
context.setStopDate(stop_date)\n
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
...@@ -64,7 +59,7 @@ if context.getStopDate() < stop_date:\n ...@@ -64,7 +59,7 @@ if context.getStopDate() < stop_date:\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>OpenSaleOrderLine_updateStopDate</string> </value> <value> <string>OpenSaleOrder_updateStopDate</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -75,26 +75,26 @@ if computer_partition.getPortalType() == \'Computer Partition\':\n ...@@ -75,26 +75,26 @@ if computer_partition.getPortalType() == \'Computer Partition\':\n
if software_instance is not None and computer_partition is not None and software_release is not None:\n if software_instance is not None and computer_partition is not None and software_release is not None:\n
slave_instance_list = []\n slave_instance_list = []\n
\n \n
sale_packing_list_line_list = computer_partition.portal_catalog(\n # sale_packing_list_line_list = computer_partition.portal_catalog(\n
aggregate_uid=computer_partition.getUid(),\n # aggregate_uid=computer_partition.getUid(),\n
portal_type="Sale Packing List Line",\n # portal_type="Sale Packing List Line",\n
simulation_state=state_list,\n # simulation_state=state_list,\n
default_resource_uid=service_uid_list)\n # default_resource_uid=service_uid_list)\n
for sale_packing_list_line in sale_packing_list_line_list:\n # for sale_packing_list_line in sale_packing_list_line_list:\n
instance = sale_packing_list_line.getAggregateValue(portal_type=instance_type_list)\n # instance = sale_packing_list_line.getAggregateValue(portal_type=instance_type_list)\n
if instance is None:\n # if instance is None:\n
raise NotImplementedError, "Unexpected Sale Packing List without Instance aggregated %s" % sale_packing_list_line.getRelativeUrl()\n # raise NotImplementedError, "Unexpected Sale Packing List without Instance aggregated %s" % sale_packing_list_line.getRelativeUrl()\n
elif instance.getPortalType() == "Slave Instance":\n # elif instance.getPortalType() == "Slave Instance":\n
slave_instance = dict(slave_title=instance.getTitle(),\n # slave_instance = dict(slave_title=instance.getTitle(),\n
slap_software_type=instance.getSourceReference(),\n # slap_software_type=instance.getSourceReference(),\n
slave_reference=instance.getReference(),\n # slave_reference=instance.getReference(),\n
xml=instance.getTextContent(),\n # xml=instance.getTextContent(),\n
connection_xml=instance.getConnectionXml(),\n # connection_xml=instance.getConnectionXml(),\n
)\n # )\n
if slave_instance not in slave_instance_list:\n # if slave_instance not in slave_instance_list:\n
slave_instance_list.append(slave_instance)\n # slave_instance_list.append(slave_instance)\n
elif instance.getPortalType() == "Software Instance":\n # elif instance.getPortalType() == "Software Instance":\n
software_instance = instance\n # software_instance = instance\n
return {\n return {\n
\'xml\':software_instance.getTextContent(),\n \'xml\':software_instance.getTextContent(),\n
\'connection_xml\':software_instance.getConnectionXml(),\n \'connection_xml\':software_instance.getConnectionXml(),\n
......
602 603
\ No newline at end of file \ 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