Commit ffdc1a45 authored by Georgios Dagkakis's avatar Georgios Dagkakis

erp5_core: Fixups in Base_getRelatedDocumentList

- Remove passing of **kw to query, since it would break Listbox
pagination
- Avoid code duplication
- Fix indentation
parent 7e922a43
Pipeline #17049 failed with stage
......@@ -9,18 +9,16 @@ if portal_type is None:
portal_type = portal.getPortalDocumentTypeList() + portal.getPortalEmbeddedDocumentTypeList()
limit = kw.pop('limit', None)
follow_up_related_document_list = portal_catalog(
portal_type=portal_type,
follow_up_uid=context.getUid(),
**kw
portal_type=portal_type,
follow_up_uid=context.getUid(),
)
document_query = Query(relative_url='%s/%%' % context.getRelativeUrl().replace('_', r'\_'))
if follow_up_related_document_list:
document_query = ComplexQuery(
Query(relative_url='%s/%%' % context.getRelativeUrl().replace('_', r'\_')),
document_query,
Query(uid=[x.getUid() for x in follow_up_related_document_list]),
logical_operator='or'
)
else:
document_query = Query(relative_url='%s/%%' % context.getRelativeUrl().replace('_', r'\_'))
if query is None:
query = document_query
else:
......
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