Commit 6162b497 authored by Sebastien Robin's avatar Sebastien Robin

get zsql method from the site, not from activity_tool, this prevent...

get zsql method from the site, not from activity_tool, this prevent acquisition problems when calling zsql methods


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4189 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 50777ff4
...@@ -954,8 +954,10 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -954,8 +954,10 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
if withCMF: if withCMF:
zope_root = getToolByName(self, 'portal_url').getPortalObject().aq_parent zope_root = getToolByName(self, 'portal_url').getPortalObject().aq_parent
site_root = getToolByName(self, 'portal_url').getPortalObject()
else: else:
zope_root = self.getPhysicalRoot() zope_root = self.getPhysicalRoot()
site_root = self.aq_parent
root_indexable = int(getattr(zope_root, 'isIndexable', 1)) root_indexable = int(getattr(zope_root, 'isIndexable', 1))
if not root_indexable: if not root_indexable:
...@@ -1050,7 +1052,7 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -1050,7 +1052,7 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
continue continue
#LOG('catalogObjectList', 0, 'method_name = %s' % (method_name,)) #LOG('catalogObjectList', 0, 'method_name = %s' % (method_name,))
method = getattr(self, method_name) method = getattr(site_root, method_name)
if method.meta_type == "Z SQL Method": if method.meta_type == "Z SQL Method":
# Build the dictionnary of values # Build the dictionnary of values
arguments = method.arguments_src arguments = method.arguments_src
...@@ -1553,7 +1555,6 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -1553,7 +1555,6 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
if k != query_table: if k != query_table:
where_expression.append('%s.uid = %s.uid' % (query_table, tid)) where_expression.append('%s.uid = %s.uid' % (query_table, tid))
# Calculate extra where_expressions based on related definition # Calculate extra where_expressions based on related definition
related_join_expression = []
for (table_list,method_id) in related_methods.keys(): for (table_list,method_id) in related_methods.keys():
related_method = getattr(self, method_id, None) related_method = getattr(self, method_id, None)
if related_method is not None: if related_method is not None:
......
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