Commit 53269ac3 authored by Vincent Pelletier's avatar Vincent Pelletier

InventoryModule_reindexMovementList: Nothing to do if there is no inventory portal type

parent 7f7aa774
...@@ -8,11 +8,14 @@ ...@@ -8,11 +8,14 @@
previous_tag = None previous_tag = None
portal = context.getPortalObject() portal = context.getPortalObject()
portal_type_list = portal.getPortalInventoryTypeList()
if not portal_type_list:
return
# We have to reindex all inventory documents in the order of the dates. # We have to reindex all inventory documents in the order of the dates.
# Uids are used to make the ordering consistent, even when multiple documents have # Uids are used to make the ordering consistent, even when multiple documents have
# the same date. # the same date.
for inventory in portal.portal_catalog(portal_type=portal.getPortalInventoryTypeList(), for inventory in portal.portal_catalog(portal_type=portal_type_list,
limit=None, limit=None,
sort_on=[('delivery.start_date', 'ascending'), ('uid', 'ascending')], sort_on=[('delivery.start_date', 'ascending'), ('uid', 'ascending')],
sql_catalog_id=sql_catalog_id): sql_catalog_id=sql_catalog_id):
......
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