Commit a249f8d0 authored by Romain Courteaud's avatar Romain Courteaud

erp5_web: only search document portal_types

parent 06799d0a
......@@ -21,6 +21,11 @@
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery, ComplexQuery
if portal is None: portal = context.getPortalObject()
# The list of portal types here should be large enough to include
# all portal_types defined in the various sections so that
# href tags which point to a document by reference can still work.
valid_portal_type_list = portal.getPortalDocumentTypeList()
# Find the applicable language
if language is None:
language = portal.Localizer.get_selected_language()
......@@ -49,6 +54,7 @@ base_sort = (('effective_date', 'descending'), )
document_list = context.searchResults(
reference=name,
effective_date=effective_date,
portal_type=valid_portal_type_list,
language=(language, ''),
sort_on=(('language', 'descending'), ) + base_sort,
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