Commit a8116b77 authored by Nicolas Dumazet's avatar Nicolas Dumazet

getMeasureRowList: call asCatalogRowList only if we later keep the measure


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30313 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d35c89e9
...@@ -874,15 +874,16 @@ class Resource(XMLMatrix, Variated): ...@@ -874,15 +874,16 @@ class Resource(XMLMatrix, Variated):
for measure in self.getMeasureList(): for measure in self.getMeasureList():
metric_type = measure.getMetricType() metric_type = measure.getMetricType()
if metric_type in metric_type_map: if metric_type in metric_type_map:
metric_type_map[metric_type] = () metric_type_map[metric_type] = None
else: else:
metric_type_map[metric_type] = measure.asCatalogRowList() metric_type_map[metric_type] = measure
if measure.getRelativeUrl() == default: if measure.getRelativeUrl() == default:
quantity_unit = '' quantity_unit = ''
insert_list = [] insert_list = []
for measure_list in metric_type_map.itervalues(): for measure in metric_type_map.itervalues():
insert_list += measure_list if measure is not None:
insert_list += measure.asCatalogRowList()
metric_type = quantity_unit.split('/', 1)[0] metric_type = quantity_unit.split('/', 1)[0]
if metric_type and metric_type not in metric_type_map: if metric_type and metric_type not in metric_type_map:
......
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