[FIX] Dirty fix: prevent crash in computing data from SCQ/MCQ/matrices by ignoring comments

bzr revid: rim@openerp.com-20140411120735-u04occnkchgm3ztc
This commit is contained in:
Richard Mathot (OpenERP) 2014-04-11 14:07:35 +02:00
parent 8ce4ac4d94
commit 41447050e5
1 changed files with 2 additions and 2 deletions

View File

@ -321,7 +321,7 @@ class survey_survey(osv.Model):
result_summary = {}
[result_summary.update({label.id: {'text': label.value, 'count': 0, 'answer_id': label.id}}) for label in question.labels_ids]
for input_line in question.user_input_line_ids:
if result_summary.get(input_line.value_suggested.id) and (not(current_filters) or input_line.user_input_id.id in current_filters):
if input_line.answer_type == 'suggestion' and result_summary.get(input_line.value_suggested.id) and (not(current_filters) or input_line.user_input_id.id in current_filters):
result_summary[input_line.value_suggested.id]['count'] += 1
result_summary = result_summary.values()
@ -333,7 +333,7 @@ class survey_survey(osv.Model):
for cell in product(rows.keys(), answers.keys()):
res[cell] = 0
for input_line in question.user_input_line_ids:
if not(current_filters) or input_line.user_input_id.id in current_filters:
if input_line.answer_type == 'suggestion' and not(current_filters) or input_line.user_input_id.id in current_filters:
res[(input_line.value_suggested_row.id, input_line.value_suggested.id)] += 1
result_summary = {'answers': answers, 'rows': rows, 'result': res}