Commit f0529181 authored by Jérome Perrin's avatar Jérome Perrin

prefer _uid over _relative_url for catalog searches

parent b84c1c64
......@@ -54,12 +54,12 @@
\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
resource_uid = production_order_line.getResourceUid()\n
if resource_uid:\n
transformation_list = portal.portal_catalog(\n
portal_type=portal.getPortalTransformationTypeList(),\n
validation_state="!=invalidated",\n
resource_relative_url=resource.getRelativeUrl())\n
default_resource_uid=resource_uid)\n
if len(transformation_list) == 1:\n
transformation = transformation_list[0].getRelativeUrl()\n
production_order_line.setSpecialise(transformation)\n
......
......@@ -291,7 +291,7 @@ class Resource(XMLObject, XMLMatrix, VariatedMixin):
if context is None:
transformation_list = self.portal_catalog(
portal_type="Transformation",
resource_relative_url=self.getRelativeUrl(),
default_resource_uid=self.getUid(),
sort_on=[('version', 'descending')],
limit=1
)
......
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