[FIX] weird dict.update calls

bzr revid: xmo@openerp.com-20120806132731-ck4usrs99qlh1pq9
This commit is contained in:
Xavier Morel
2012-08-06 15:27:31 +02:00
parent 6d6e66cfc1
commit 346397530d
+4 -6
View File
@@ -2434,9 +2434,9 @@ class BaseModel(object):
context=context)
result_template = dict.fromkeys(aggregated_fields, False)
result_template.update({groupby + '_count':0})
result_template[groupby + '_count'] = 0
if groupby_list and len(groupby_list) > 1:
result_template.update(__context={'group_by': groupby_list[1:]})
result_template['__context'] = {'group_by': groupby_list[1:]}
# Merge the left_side (current results as dicts) with the right_side (all
# possible values as m2o pairs). Both lists are supposed to be using the
@@ -2455,10 +2455,8 @@ class BaseModel(object):
grouped_value = right_side[0]
if not grouped_value in known_values:
line = dict(result_template)
line.update({
groupby: right_side,
'__domain': [(groupby,'=',grouped_value)] + domain,
})
line[groupby] = right_side
line['__domain'] = [(groupby,'=',grouped_value)] + domain
result.append(line)
known_values[grouped_value] = line
while read_group_result or all_groups: