From 4b5dca8f67e54cf5dc34523cb89b0652c51916e8 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Sun, 3 Mar 2013 12:45:37 +0100 Subject: [PATCH] [IMP] survey: matrix of radio button bzr revid: chm@openerp.com-20130303114537-d3ql5sji0pi2mt7w --- addons/survey/wizard/survey_answer.py | 6 ++++-- addons/survey/wizard/survey_answer.xml | 1 - addons/survey/wizard/survey_email_compose_message.xml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/addons/survey/wizard/survey_answer.py b/addons/survey/wizard/survey_answer.py index cde555c32df..9231ff3dc79 100644 --- a/addons/survey/wizard/survey_answer.py +++ b/addons/survey/wizard/survey_answer.py @@ -172,10 +172,12 @@ class survey_question_wiz(osv.osv_memory): col = "2" colspan = "2" xml_group = etree.SubElement(xml_group, 'group', {'col': tools.ustr(col), 'colspan': tools.ustr(colspan)}) + first = True for row in que_rec.answer_choice_ids: etree.SubElement(xml_group, 'newline') - etree.SubElement(xml_group, 'field', {'modifiers': readonly and '{"readonly": 1}' or '{}', 'name': tools.ustr(que.id) + "_selection_" + tools.ustr(row.id), 'string': to_xml(tools.ustr(row.answer))}) - selection = [('', '')] + etree.SubElement(xml_group, 'field', {'widget': 'radio', 'horizontal': '1', 'no_radiolabel': not first and '1' or '0', 'modifiers': readonly and '{"readonly": 1}' or '{}', 'name': tools.ustr(que.id) + "_selection_" + tools.ustr(row.id), 'string': to_xml(tools.ustr(row.answer))}) + first = False + selection = [] for col in que_rec.column_heading_ids: selection.append((str(col.id), col.title)) fields[tools.ustr(que.id) + "_selection_" + tools.ustr(row.id)] = {'type': 'selection', 'selection': selection, 'string': "Answer"} diff --git a/addons/survey/wizard/survey_answer.xml b/addons/survey/wizard/survey_answer.xml index 8095dba93e6..3e0d6cbafab 100644 --- a/addons/survey/wizard/survey_answer.xml +++ b/addons/survey/wizard/survey_answer.xml @@ -67,7 +67,6 @@ Complete Survey Answer survey.question.wiz 2 - inline
diff --git a/addons/survey/wizard/survey_email_compose_message.xml b/addons/survey/wizard/survey_email_compose_message.xml index cb98fa051f9..45132801cd7 100644 --- a/addons/survey/wizard/survey_email_compose_message.xml +++ b/addons/survey/wizard/survey_email_compose_message.xml @@ -32,7 +32,7 @@ - +