Commit 8d14952d authored by Łukasz Nowak's avatar Łukasz Nowak

- do not hardcode portal type

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22144 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d91db01d
...@@ -78,7 +78,7 @@ if resource is None:\n ...@@ -78,7 +78,7 @@ if resource is None:\n
\n \n
# XXX: Is it possible to use cache? Hook it on resource?\n # XXX: Is it possible to use cache? Hook it on resource?\n
for transformation in LazyFilter(\n for transformation in LazyFilter(\n
resource.getResourceRelatedValueList(portal_type=\'Transformation\'),\n resource.getResourceRelatedValueList(portal_type=portal.getPortalTransformationTypeList()),\n
skip=\'View\'\n skip=\'View\'\n
):\n ):\n
if not skip_invalidated or transformation.getProperty(\'validation_state\',\'default\') != \'invalidated\':\n if not skip_invalidated or transformation.getProperty(\'validation_state\',\'default\') != \'invalidated\':\n
......
...@@ -66,11 +66,12 @@ ...@@ -66,11 +66,12 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>production_order_line = state_change[\'object\']\n <value> <string>production_order_line = state_change[\'object\']\n
portal = production_order_line.getPortalObject()\n
\n \n
transformation = None\n transformation = None\n
resource = production_order_line.getResourceValue()\n resource = production_order_line.getResourceValue()\n
if resource is not None:\n if resource is not None:\n
transformation_list = [q for q in resource.getResourceRelatedValueList(portal_type=\'Transformation\') \\\n transformation_list = [q for q in resource.getResourceRelatedValueList(portal_type=portal.getPortalTransformationTypeList()) \\\n
if q.getProperty(\'validation_state\',\'default\') != \'invalidated\']\n if q.getProperty(\'validation_state\',\'default\') != \'invalidated\']\n
if len(transformation_list) == 1:\n if len(transformation_list) == 1:\n
transformation = transformation_list[0].getRelativeUrl()\n transformation = transformation_list[0].getRelativeUrl()\n
...@@ -120,9 +121,10 @@ production_order_line.setSpecialise(transformation)\n ...@@ -120,9 +121,10 @@ production_order_line.setSpecialise(transformation)\n
<string>state_change</string> <string>state_change</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>production_order_line</string> <string>production_order_line</string>
<string>_getattr_</string>
<string>portal</string>
<string>None</string> <string>None</string>
<string>transformation</string> <string>transformation</string>
<string>_getattr_</string>
<string>resource</string> <string>resource</string>
<string>append</string> <string>append</string>
<string>$append0</string> <string>$append0</string>
......
293 297
\ 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