Commit 16b0f092 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

do not hardcode filter portal types, but check if updateMatrix() exists or not.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33329 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d8b183c7
...@@ -35,6 +35,12 @@ ...@@ -35,6 +35,12 @@
</list> </list>
</value> </value>
</item> </item>
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -58,13 +64,14 @@ ...@@ -58,13 +64,14 @@
</list> </list>
</value> </value>
</item> </item>
<item>
<key> <string>once_per_transaction</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>portal_type_filter</string> </key> <key> <string>portal_type_filter</string> </key>
<value> <value>
<list> <none/>
<string>Invoice Transaction Rule</string>
<string>Payment Rule</string>
</list>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -35,6 +35,12 @@ ...@@ -35,6 +35,12 @@
<tuple/> <tuple/>
</value> </value>
</item> </item>
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -57,12 +63,14 @@ ...@@ -57,12 +63,14 @@
</list> </list>
</value> </value>
</item> </item>
<item>
<key> <string>once_per_transaction</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>portal_type_filter</string> </key> <key> <string>portal_type_filter</string> </key>
<value> <value>
<list> <none/>
<string>Invoice Transaction Rule</string>
</list>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -54,8 +54,7 @@ ...@@ -54,8 +54,7 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>rule = state_change[\'object\'].getParentValue()\n <value> <string>rule = state_change[\'object\'].getParentValue()\n
\n if getattr(rule, \'updateMatrix\', None) is not None:\n
if rule.getPortalType() in (\'Invoice Transaction Rule\', \'Payment Rule\') :\n
rule.activate(\n rule.activate(\n
after_path_and_method_id=([rule.getPath(),],\n after_path_and_method_id=([rule.getPath(),],\n
[\'immediateReindexObject\', \'recursiveImmediateReindexObject\'])\n [\'immediateReindexObject\', \'recursiveImmediateReindexObject\'])\n
...@@ -100,6 +99,8 @@ if rule.getPortalType() in (\'Invoice Transaction Rule\', \'Payment Rule\') :\n ...@@ -100,6 +99,8 @@ if rule.getPortalType() in (\'Invoice Transaction Rule\', \'Payment Rule\') :\n
<string>_getattr_</string> <string>_getattr_</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>rule</string> <string>rule</string>
<string>getattr</string>
<string>None</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -54,7 +54,8 @@ ...@@ -54,7 +54,8 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>matrix = state_change[\'object\']\n <value> <string>matrix = state_change[\'object\']\n
matrix.activate(\n if getattr(matrix, \'updateMatrix\', None) is not None:\n
matrix.activate(\n
after_path_and_method_id=([matrix.getPath(),],\n after_path_and_method_id=([matrix.getPath(),],\n
[\'immediateReindexObject\', \'recursiveImmediateReindexObject\'])\n [\'immediateReindexObject\', \'recursiveImmediateReindexObject\'])\n
).updateMatrix()\n ).updateMatrix()\n
...@@ -97,6 +98,8 @@ matrix.activate(\n ...@@ -97,6 +98,8 @@ matrix.activate(\n
<string>state_change</string> <string>state_change</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>matrix</string> <string>matrix</string>
<string>getattr</string>
<string>None</string>
<string>_getattr_</string> <string>_getattr_</string>
</tuple> </tuple>
</value> </value>
......
1499 1500
\ 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