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):
for measure in self.getMeasureList():
metric_type = measure.getMetricType()
if metric_type in metric_type_map:
metric_type_map[metric_type] = ()
metric_type_map[metric_type] = None
else:
metric_type_map[metric_type] = measure.asCatalogRowList()
metric_type_map[metric_type] = measure
if measure.getRelativeUrl() == default:
quantity_unit = ''
insert_list = []
for measure_list in metric_type_map.itervalues():
insert_list += measure_list
for measure in metric_type_map.itervalues():
if measure is not None:
insert_list += measure.asCatalogRowList()
metric_type = quantity_unit.split('/', 1)[0]
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