Commit 6ab023a5 authored by Ayush Tiwari's avatar Ayush Tiwari

erp5_catalog: Use external method for getSQLCatalogIdList method from ZCatalog

parent 331db2f2
......@@ -104,4 +104,19 @@ def getPythonMethodIdsUnrestricted(self):
# Get current SQL Catalog objects
default_sql_catalog = portal.portal_catalog.getSQLCatalog()
return default_sql_catalog.getPythonMethodIds()
\ No newline at end of file
return default_sql_catalog.getPythonMethodIds()
def getSQLCatalogIdListUnrestricted(self):
"""
This fucntion calls getSQLCatalogIdList function from ZCatalog Class.
The reason we need it here is that we need to get the result from the
restricted environment which isn't possible from inside ERP5.
This is because we are moving SQL Catalog inside ERP5 and converting it to
Folder object.
"""
# Get portal object
portal = self.getPortalObject()
return portal.portal_catalog.getSQLCatalogIdList()
return sorted(context.getPortalObject().portal_catalog.getSQLCatalogIdList())
return sorted(context.getPortalObject().portal_catalog.CatalogTool_getSQLCatalogIdList())
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>getSQLCatalogIdListUnrestricted</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>CatalogUnrestricted</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>CatalogTool_getSQLCatalogIdList</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -130,7 +130,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.getSQLCatalogIdList()</string> </value>
<value> <string>python:here.getPortalObject().portal_catalog.CatalogTool_getSQLCatalogIdList()</string> </value>
</item>
</dictionary>
</pickle>
......
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