From b5de38f2875759230e7f46997761ea442ccbbd97 Mon Sep 17 00:00:00 2001 From: "Richard Mathot (OpenERP)" Date: Wed, 18 Dec 2013 08:20:04 +0100 Subject: [PATCH] [FIX] Small fix in answer recording bzr revid: rim@openerp.com-20131218072004-jzo8ozonyxv9a0jw --- addons/survey/controllers/main.py | 2 ++ addons/survey/survey.py | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/addons/survey/controllers/main.py b/addons/survey/controllers/main.py index 6419a67be10..a724e2849dd 100644 --- a/addons/survey/controllers/main.py +++ b/addons/survey/controllers/main.py @@ -205,6 +205,8 @@ class WebsiteSurvey(http.Controller): answer_value = answer.value_number.__str__() elif answer.answer_type == 'date': answer_value = answer.value_date + elif answer.answer_type == 'suggestion': + answer_value = answer.value_suggested.id # TODO mettre les QCM ici if answer_value: ret.update({answer_tag: answer_value}) diff --git a/addons/survey/survey.py b/addons/survey/survey.py index e7cf0c648ab..3065ba218b5 100644 --- a/addons/survey/survey.py +++ b/addons/survey/survey.py @@ -962,6 +962,7 @@ class survey_user_input_line(osv.osv): 'question_id': question.id, 'page_id': question.page_id.id, 'survey_id': question.survey_id.id, + 'skipped': False } if answer_tag in post and post[answer_tag].strip() != '': vals.update({'answer_type': 'free_text', 'value_free_text': post[answer_tag]}) @@ -983,6 +984,7 @@ class survey_user_input_line(osv.osv): 'question_id': question.id, 'page_id': question.page_id.id, 'survey_id': question.survey_id.id, + 'skipped': False } if answer_tag in post and post[answer_tag].strip() != '': vals.update({'answer_type': 'text', 'value_text': post[answer_tag]}) @@ -1004,6 +1006,7 @@ class survey_user_input_line(osv.osv): 'question_id': question.id, 'page_id': question.page_id.id, 'survey_id': question.survey_id.id, + 'skipped': False } if answer_tag in post and post[answer_tag].strip() != '': vals.update({'answer_type': 'number', 'value_number': float(post[answer_tag])}) @@ -1025,6 +1028,7 @@ class survey_user_input_line(osv.osv): 'question_id': question.id, 'page_id': question.page_id.id, 'survey_id': question.survey_id.id, + 'skipped': False } if answer_tag in post and post[answer_tag].strip() != '': vals.update({'answer_type': 'date', 'value_date': post[answer_tag]}) @@ -1046,6 +1050,7 @@ class survey_user_input_line(osv.osv): 'question_id': question.id, 'page_id': question.page_id.id, 'survey_id': question.survey_id.id, + 'skipped': False } if answer_tag in post and post[answer_tag].strip() != '': vals.update({'answer_type': 'suggestion', 'value_suggested': post[answer_tag]}) @@ -1062,6 +1067,8 @@ class survey_user_input_line(osv.osv): return True + # def save_line_multiple_choice: + def dict_keys_startswith(dictionary, string): '''Returns a dictionary containing the elements of whose keys start with .