Commit 139b2aec authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

* Improve activity dependencies for Delivery_updateAppliedRule, eg....

* Improve activity dependencies for Delivery_updateAppliedRule, eg. delivery.activate(tag='(path)_updateAppliedRule', after_tag='(path)_expand').Delivery_updateAppliedRule(activate_kw={'tag':'(path)_expand'})


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35571 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9365bc14
...@@ -56,18 +56,18 @@ ...@@ -56,18 +56,18 @@
<value> <string>delivery = context\n <value> <string>delivery = context\n
delivery_path = delivery.getPath()\n delivery_path = delivery.getPath()\n
path_and_method_id = (delivery_path, (\'immediateReindexObject\',\'recursiveImmediateReindexObject\'))\n path_and_method_id = (delivery_path, (\'immediateReindexObject\',\'recursiveImmediateReindexObject\'))\n
after_tag = (delivery_path + \'_firstUpdateAppliedRule\', delivery_path + \'_expand\')\n expand_tag = delivery_path + \'_expand\'\n
tag = delivery_path + \'_updateAppliedRule\'\n tag = delivery_path + \'_updateAppliedRule\'\n
\n \n
priority = 3\n priority = 3\n
\n \n
activate_kw = { \n activate_kw = { \n
\'tag\': tag,\n \'tag\': expand_tag,\n
\'priority\': priority,\n \'priority\': priority,\n
}\n }\n
delivery.activate(\n delivery.activate(\n
after_path_and_method_id=path_and_method_id,\n after_path_and_method_id=path_and_method_id,\n
after_tag=after_tag,\n after_tag=expand_tag,\n
tag=tag,\n tag=tag,\n
priority=priority,\n priority=priority,\n
).Delivery_updateAppliedRule(activate_kw=activate_kw)\n ).Delivery_updateAppliedRule(activate_kw=activate_kw)\n
...@@ -112,7 +112,7 @@ delivery.activate(\n ...@@ -112,7 +112,7 @@ delivery.activate(\n
<string>_getattr_</string> <string>_getattr_</string>
<string>delivery_path</string> <string>delivery_path</string>
<string>path_and_method_id</string> <string>path_and_method_id</string>
<string>after_tag</string> <string>expand_tag</string>
<string>tag</string> <string>tag</string>
<string>priority</string> <string>priority</string>
<string>activate_kw</string> <string>activate_kw</string>
......
750 751
\ No newline at end of file \ No newline at end of file
...@@ -55,10 +55,12 @@ ...@@ -55,10 +55,12 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>order = state_change[\'object\']\n <value> <string>order = state_change[\'object\']\n
\n \n
tag = order.getPath() + \'_firstUpdateAppliedRule\'\n path = order.getPath()\n
activate_kw = {\'tag\':tag,\'priority\':3}\n tag = \'%s_updateAppliedRule\' % path\n
order.activate(tag=tag).updateAppliedRule(rule_reference=order.getRuleReference(),\n expand_tag = \'%s_expand\' % path\n
activate_kw=activate_kw)\n activate_kw = {\'tag\':expand_tag, \'priority\':3}\n
\n
order.activate(tag=tag, after_tag=expand_tag).Delivery_updateAppliedRule(activate_kw=activate_kw)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -100,7 +102,9 @@ order.activate(tag=tag).updateAppliedRule(rule_reference=order.getRuleReference( ...@@ -100,7 +102,9 @@ order.activate(tag=tag).updateAppliedRule(rule_reference=order.getRuleReference(
<string>_getitem_</string> <string>_getitem_</string>
<string>order</string> <string>order</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>path</string>
<string>tag</string> <string>tag</string>
<string>expand_tag</string>
<string>activate_kw</string> <string>activate_kw</string>
</tuple> </tuple>
</value> </value>
......
254 255
\ No newline at end of file \ No newline at end of file
...@@ -74,10 +74,10 @@ else:\n ...@@ -74,10 +74,10 @@ else:\n
]\n ]\n
\n \n
order_path = order.getPath()\n order_path = order.getPath()\n
previous_tag = order_path + \'_firstUpdateAppliedRule\'\n tag = order_path + \'_updateAppliedRule\'\n
expand_tag = order_path + \'_expand\'\n expand_tag = order_path + \'_expand\'\n
activate_kw = {\'tag\':expand_tag, \'priority\':3}\n activate_kw = {\'tag\':expand_tag, \'priority\':3}\n
order.activate(tag=expand_tag, after_tag=previous_tag).updateAppliedRule(rule_reuference=rule_reference, activate_kw=activate_kw)\n order.activate(tag=tag, after_tag=expand_tag).updateAppliedRule(rule_reuference=rule_reference, activate_kw=activate_kw)\n
\n \n
for i in xrange(len(builder_list)):\n for i in xrange(len(builder_list)):\n
if i > 0:\n if i > 0:\n
......
...@@ -64,9 +64,11 @@ if (business_process is not None and\n ...@@ -64,9 +64,11 @@ if (business_process is not None and\n
else:\n else:\n
rule_reference=\'default_production_order_rule\'\n rule_reference=\'default_production_order_rule\'\n
\n \n
tag = order.getPath() + \'_firstUpdateAppliedRule\'\n path = order.getPath()\n
activate_kw = {\'tag\':tag,\'priority\':3}\n tag = \'%s_updateAppliedRule\' % path\n
order.activate(tag=tag).updateAppliedRule(rule_reference=rule_reference, activate_kw=activate_kw)\n expand_tag = \'%s_expand\' % path\n
activate_kw = {\'tag\':expand_tag, \'priority\':3}\n
order.activate(tag=tag, after_tag=expand_tag).updateAppliedRule(rule_reference=rule_reference, activate_kw=activate_kw)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -112,7 +114,9 @@ order.activate(tag=tag).updateAppliedRule(rule_reference=rule_reference, activat ...@@ -112,7 +114,9 @@ order.activate(tag=tag).updateAppliedRule(rule_reference=rule_reference, activat
<string>None</string> <string>None</string>
<string>context</string> <string>context</string>
<string>rule_reference</string> <string>rule_reference</string>
<string>path</string>
<string>tag</string> <string>tag</string>
<string>expand_tag</string>
<string>activate_kw</string> <string>activate_kw</string>
</tuple> </tuple>
</value> </value>
......
441 442
\ No newline at end of file \ No newline at end of file
...@@ -56,13 +56,14 @@ ...@@ -56,13 +56,14 @@
<value> <string>order = state_change[\'object\']\n <value> <string>order = state_change[\'object\']\n
transition_kw = state_change[\'kwargs\']\n transition_kw = state_change[\'kwargs\']\n
\n \n
previous_tag = order.getPath() + \'_firstUpdateAppliedRule\'\n path = order.getPath()\n
expand_tag = order.getPath() + \'_expand\'\n tag = \'%s_updateAppliedRule\' % path\n
activate_kw = {\'tag\':expand_tag,\'priority\':3}\n expand_tag = \'%s_expand\' % path\n
activate_kw = {\'tag\':expand_tag, \'priority\':3}\n
kw = {}\n kw = {}\n
if transition_kw.get(\'calculation_base_date\') is not None:\n if transition_kw.get(\'calculation_base_date\') is not None:\n
kw[\'calculation_base_date\'] = transition_kw[\'calculation_base_date\']\n kw[\'calculation_base_date\'] = transition_kw[\'calculation_base_date\']\n
order.activate(tag=expand_tag, after_tag=previous_tag).updateAppliedRule(\n order.activate(tag=tag, after_tag=expand_tag).updateAppliedRule(\n
rule_reference=\'default_open_order_rule\', activate_kw=activate_kw, **kw)\n rule_reference=\'default_open_order_rule\', activate_kw=activate_kw, **kw)\n
\n \n
\n \n
...@@ -111,7 +112,8 @@ if order_portal_type == \'Open Sale Order\':\n ...@@ -111,7 +112,8 @@ if order_portal_type == \'Open Sale Order\':\n
<string>order</string> <string>order</string>
<string>transition_kw</string> <string>transition_kw</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>previous_tag</string> <string>path</string>
<string>tag</string>
<string>expand_tag</string> <string>expand_tag</string>
<string>activate_kw</string> <string>activate_kw</string>
<string>kw</string> <string>kw</string>
......
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'})
2010-03-17 tatuya 2010-03-17 tatuya
* Add a type based method Script (Python) so that Open Sale Order document will find the root applied rule. * Add a type based method Script (Python) so that Open Sale Order document will find the root applied rule.
......
15 16
\ 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