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 @@
</list>
</value>
</item>
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
......@@ -58,13 +64,14 @@
</list>
</value>
</item>
<item>
<key> <string>once_per_transaction</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<list>
<string>Invoice Transaction Rule</string>
<string>Payment Rule</string>
</list>
<none/>
</value>
</item>
<item>
......
......@@ -35,6 +35,12 @@
<tuple/>
</value>
</item>
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
......@@ -57,12 +63,14 @@
</list>
</value>
</item>
<item>
<key> <string>once_per_transaction</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<list>
<string>Invoice Transaction Rule</string>
</list>
<none/>
</value>
</item>
<item>
......
......@@ -54,8 +54,7 @@
<item>
<key> <string>_body</string> </key>
<value> <string>rule = state_change[\'object\'].getParentValue()\n
\n
if rule.getPortalType() in (\'Invoice Transaction Rule\', \'Payment Rule\') :\n
if getattr(rule, \'updateMatrix\', None) is not None:\n
rule.activate(\n
after_path_and_method_id=([rule.getPath(),],\n
[\'immediateReindexObject\', \'recursiveImmediateReindexObject\'])\n
......@@ -100,6 +99,8 @@ if rule.getPortalType() in (\'Invoice Transaction Rule\', \'Payment Rule\') :\n
<string>_getattr_</string>
<string>_getitem_</string>
<string>rule</string>
<string>getattr</string>
<string>None</string>
</tuple>
</value>
</item>
......
......@@ -54,7 +54,8 @@
<item>
<key> <string>_body</string> </key>
<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
[\'immediateReindexObject\', \'recursiveImmediateReindexObject\'])\n
).updateMatrix()\n
......@@ -97,6 +98,8 @@ matrix.activate(\n
<string>state_change</string>
<string>_getitem_</string>
<string>matrix</string>
<string>getattr</string>
<string>None</string>
<string>_getattr_</string>
</tuple>
</value>
......
1499
\ No newline at end of file
1500
\ 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