[IMP] survey: matrix of radio button

bzr revid: chm@openerp.com-20130303114537-d3ql5sji0pi2mt7w
This commit is contained in:
Christophe Matthieu
2013-03-03 12:45:37 +01:00
parent 0908064d2d
commit 4b5dca8f67
3 changed files with 5 additions and 4 deletions
+4 -2
View File
@@ -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"}
-1
View File
@@ -67,7 +67,6 @@
<field name="name">Complete Survey Answer</field>
<field name="model">survey.question.wiz</field>
<field name="priority">2</field>
<field name="target">inline</field>
<field name="arch" type="xml">
<form string="Your Messages" version="7.0">
<sheet>
@@ -32,7 +32,7 @@
<field name="res_id" invisible="1"/>
<field name="parent_id" invisible="1"/>
<group col="2" invisible="context.get('survey_resent_token')">
<field name="public"/>
<field name="public" widget="radio"/>
</group>
<group col="1" invisible="context.get('survey_resent_token')" attrs="{'invisible':[('public','in',['email', 'email_public_link'])]}" class="oe_survey_email_public">
<div>