Commit 9a7fe036 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

* Use the same dependencies for Delivery_updateApplideRule to make it possible to merge activities.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35844 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d1793c84
......@@ -54,13 +54,23 @@
<item>
<key> <string>_body</string> </key>
<value> <string>order = state_change[\'object\']\n
order_path = order.getPath()\n
path_and_method_id = (order_path, (\'immediateReindexObject\',\'recursiveImmediateReindexObject\'))\n
expand_tag = order_path + \'_expand\'\n
tag = order_path + \'_updateAppliedRule\'\n
\n
path = order.getPath()\n
tag = \'%s_updateAppliedRule\' % path\n
expand_tag = \'%s_expand\' % path\n
activate_kw = {\'tag\':expand_tag, \'priority\':3}\n
priority = 3\n
\n
order.activate(tag=tag, after_tag=expand_tag).Delivery_updateAppliedRule(activate_kw=activate_kw)\n
activate_kw = { \n
\'tag\': expand_tag,\n
\'priority\': priority,\n
}\n
order.activate(\n
after_path_and_method_id=path_and_method_id,\n
after_tag=expand_tag,\n
tag=tag,\n
priority=priority,\n
).Delivery_updateAppliedRule(activate_kw=activate_kw)\n
\n
order_portal_type = order.getPortalType()\n
builder_dict = {\n
......@@ -68,7 +78,7 @@ builder_dict = {\n
\'Purchase Order\':\'purchase_packing_list_builder\',\n
\'Internal Order\':\'internal_packing_list_builder\',\n
}\n
delivery_builder = getattr(order.portal_deliveries, builder_dict[order_portal_type])\n
delivery_builder = getattr(order.getPortalObject().portal_deliveries, builder_dict[order_portal_type])\n
\n
delivery_builder.activate(activity=\'SQLQueue\', after_tag=(tag, expand_tag)).build(explanation_uid=order.getUid())\n
</string> </value>
......@@ -111,9 +121,11 @@ delivery_builder.activate(activity=\'SQLQueue\', after_tag=(tag, expand_tag)).bu
<string>_getitem_</string>
<string>order</string>
<string>_getattr_</string>
<string>path</string>
<string>tag</string>
<string>order_path</string>
<string>path_and_method_id</string>
<string>expand_tag</string>
<string>tag</string>
<string>priority</string>
<string>activate_kw</string>
<string>order_portal_type</string>
<string>builder_dict</string>
......
......@@ -54,13 +54,23 @@
<item>
<key> <string>_body</string> </key>
<value> <string>order = state_change[\'object\']\n
order_path = order.getPath()\n
path_and_method_id = (order_path, (\'immediateReindexObject\',\'recursiveImmediateReindexObject\'))\n
expand_tag = order_path + \'_expand\'\n
tag = order_path + \'_updateAppliedRule\'\n
\n
path = order.getPath()\n
tag = \'%s_updateAppliedRule\' % path\n
expand_tag = \'%s_expand\' % path\n
activate_kw = {\'tag\':expand_tag, \'priority\':3}\n
priority = 3\n
\n
order.activate(tag=tag, after_tag=expand_tag).Delivery_updateAppliedRule(activate_kw=activate_kw)\n
activate_kw = { \n
\'tag\': expand_tag,\n
\'priority\': priority,\n
}\n
order.activate(\n
after_path_and_method_id=path_and_method_id,\n
after_tag=expand_tag,\n
tag=tag,\n
priority=priority,\n
).Delivery_updateAppliedRule(activate_kw=activate_kw)\n
</string> </value>
</item>
<item>
......@@ -102,9 +112,11 @@ order.activate(tag=tag, after_tag=expand_tag).Delivery_updateAppliedRule(activat
<string>_getitem_</string>
<string>order</string>
<string>_getattr_</string>
<string>path</string>
<string>tag</string>
<string>order_path</string>
<string>path_and_method_id</string>
<string>expand_tag</string>
<string>tag</string>
<string>priority</string>
<string>activate_kw</string>
</tuple>
</value>
......
......@@ -60,6 +60,7 @@ related_order = packing_list.getCausalityValue()\n
path = packing_list.getPath()\n
tag = \'%s_updateAppliedRule\' % path\n
expand_tag = \'%s_expand\' % path\n
path_and_method_id = (path, (\'immediateReindexObject\',\'recursiveImmediateReindexObject\'))\n
activate_kw = {\'tag\':expand_tag,\'priority\':3}\n
after_tag_list = [expand_tag]\n
if related_order is not None:\n
......@@ -68,6 +69,7 @@ if related_order is not None:\n
\n
packing_list.activate(after_tag=after_tag_list,\n
tag=tag,\n
after_path_and_method_id=path_and_method_id,\n
priority=3).Delivery_updateAppliedRule(activate_kw=activate_kw)\n
\n
\n
......@@ -77,6 +79,7 @@ packing_list.activate(after_tag=after_tag_list,\n
# XXX is it really required?\n
packing_list.activate(after_tag=after_tag_list,\n
tag=tag,\n
after_path_and_method_id=path_and_method_id,\n
priority=3).applyToDeliveryRelatedMovement(method_id=\'reindexObject\')\n
\n
if packing_list.getCausalityState() == \'draft\':\n
......@@ -131,6 +134,7 @@ packing_list.activate(\n
<string>path</string>
<string>tag</string>
<string>expand_tag</string>
<string>path_and_method_id</string>
<string>after_tag_list</string>
<string>None</string>
</tuple>
......
......@@ -61,8 +61,10 @@ if not delivery.isDelivery:\n
return\n
\n
# copy&paste from delivery_movement_simulation_interaction_workflow/scripts/DeliveryMovement_updateSimulation\n
path_and_method_id = (delivery.getPath(), (\'immediateReindexObject\',\'recursiveImmediateReindexObject\'))\n
expand_tag = delivery.getPath() + \'_updateAppliedRule\'\n
delivery_path = delivery.getPath()\n
path_and_method_id = (delivery_path, (\'immediateReindexObject\',\'recursiveImmediateReindexObject\'))\n
expand_tag = delivery_path + \'_updateAppliedRule\'\n
tag = delivery_path + \'_updateAppliedRule\'\n
\n
priority = 3\n
\n
......@@ -72,7 +74,8 @@ activate_kw = { \n
}\n
delivery.activate(\n
after_path_and_method_id=path_and_method_id,\n
tag=expand_tag,\n
after_tag=expand_tag,\n
tag=tag,\n
priority=priority,\n
).Delivery_updateAppliedRule(activate_kw=activate_kw)\n
......@@ -119,6 +122,7 @@ delivery.activate(\n
<string>delivery</string>
<string>path_and_method_id</string>
<string>expand_tag</string>
<string>tag</string>
<string>priority</string>
<string>activate_kw</string>
</tuple>
......
2010-06-01 kazuhiko
* Use the same dependencies for Delivery_updateApplideRule to make it possible to merge activities.
2010-05-24 kazuhiko
* Improve activity dependencies for Delivery_updateAppliedRule, eg. delivery.activate(tag='(path)_updateAppliedRule', after_tag='(path)_expand').Delivery_updateAppliedRule(activate_kw={'tag':'(path)_expand'})
......
946
\ No newline at end of file
947
\ 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