Commit 4775eaac authored by Romain Courteaud's avatar Romain Courteaud

Do not modify existing specialise value.

Prevent accessing ZODB objects by filtering more with MySQL.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34789 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9498b936
......@@ -54,16 +54,18 @@
<item>
<key> <string>_body</string> </key>
<value> <string>production_order_line = state_change[\'object\']\n
portal = production_order_line.getPortalObject()\n
\n
transformation = None\n
resource = production_order_line.getResourceValue()\n
if resource is not None:\n
transformation_list = [q for q in resource.getResourceRelatedValueList(portal_type=portal.getPortalTransformationTypeList()) \\\n
if q.getProperty(\'validation_state\',\'default\') != \'invalidated\']\n
if len(transformation_list) == 1:\n
transformation = transformation_list[0].getRelativeUrl()\n
production_order_line.setSpecialise(transformation)\n
if not production_order_line.hasSpecialise():\n
portal = production_order_line.getPortalObject()\n
resource = production_order_line.getResourceValue()\n
if resource is not None:\n
transformation_list = portal.portal_catalog(\n
portal_type=portal.getPortalTransformationTypeList(),\n
validation_state="!=invalidated",\n
resource_value=resource)\n
if len(transformation_list) == 1:\n
transformation = transformation_list[0].getRelativeUrl()\n
production_order_line.setSpecialise(transformation)\n
</string> </value>
</item>
<item>
......@@ -105,15 +107,11 @@ production_order_line.setSpecialise(transformation)\n
<string>production_order_line</string>
<string>_getattr_</string>
<string>portal</string>
<string>None</string>
<string>transformation</string>
<string>resource</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>q</string>
<string>None</string>
<string>transformation_list</string>
<string>len</string>
<string>transformation</string>
</tuple>
</value>
</item>
......
435
\ No newline at end of file
438
\ 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