Commit f6b4fc4a authored by Klaus Wölfel's avatar Klaus Wölfel

data analysis creation: workaround the case that no device configuration portal type exists

without this work around aggregate from any portal type would be returned, because getAggregateValue(portal_type=[]) does not return None as expected. This must be fixed properly in generic erp5
parent 1c608aac
...@@ -55,7 +55,12 @@ for movement in portal_catalog(query): ...@@ -55,7 +55,12 @@ for movement in portal_catalog(query):
aggregate_set = set() aggregate_set = set()
# manually add device and device configuration to every line # manually add device and device configuration to every line
aggregate_set.add(movement.getAggregateDevice()) aggregate_set.add(movement.getAggregateDevice())
aggregate_set.add(movement.getAggregateDeviceConfiguration()) # workaround the case that device configuration portal type exists
# without this work around aggregate from any portal type
# would be returned, because getAggregateValue(portal_type=[]) does not
# return None as expected. This must be fixed properly in generic erp5
if portal.getPortalDeviceConfigurationTypeList():
aggregate_set.add(movement.getAggregateDeviceConfiguration())
if transformation_line.getPortalType() == \ if transformation_line.getPortalType() == \
"Data Transformation Resource Line": "Data Transformation Resource Line":
# at the moment, we only check for positive or negative quantity # at the moment, we only check for positive or negative quantity
......
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