[IMP] survey: change kanban, remove Matrix of Drop-down Menus
bzr revid: chm@openerp.com-20130208161504-9zfiwisrhe8y0xbn
This commit is contained in:
@@ -330,54 +330,6 @@ class survey_analysis(report_rml):
|
||||
<td><para style="answer_right">""" + tools.ustr(res_count) + """</para></td></tr>"""
|
||||
rml += """</blockTable>"""
|
||||
|
||||
elif que.type in['matrix_of_drop_down_menus']:
|
||||
for column in que.column_heading_ids:
|
||||
rml += """<blockTable colWidths="500" style="Table1"><tr>
|
||||
<td><para style="answer">""" + to_xml(tools.ustr(column.title)) + """</para></td></tr></blockTable>"""
|
||||
menu_choices = column.menu_choice.split('\n')
|
||||
cols_widhts = []
|
||||
cols_widhts.append(200)
|
||||
for col in range(0, len(menu_choices) + 1):
|
||||
cols_widhts.append(float(300 / (len(menu_choices) + 1)))
|
||||
colWidths = ",".join(map(tools.ustr, cols_widhts))
|
||||
rml += """<blockTable colWidths=" """ + colWidths + """ " style="Table1"><tr>
|
||||
<td><para style="response"></para></td>"""
|
||||
|
||||
for menu in menu_choices:
|
||||
rml += """<td><para style="response">""" + to_xml(tools.ustr(menu)) + """</para></td>"""
|
||||
rml += """<td><para style="response-bold">Answer Count</para></td></tr>"""
|
||||
cr.execute("select count(id), sra.answer_id from survey_response_answer sra \
|
||||
where sra.column_id='%s' group by sra.answer_id ", (column.id,))
|
||||
res_count = cr.dictfetchall()
|
||||
cr.execute("select count(sra.id),sra.value_choice, sra.answer_id, sra.column_id from survey_response_answer sra \
|
||||
where sra.column_id='%s' group by sra.value_choice ,sra.answer_id, sra.column_id", (column.id,))
|
||||
calc_percantage = cr.dictfetchall()
|
||||
|
||||
for ans in que.answer_choice_ids:
|
||||
rml += """<tr><td><para style="answer_right">""" + to_xml(tools.ustr(ans.answer)) + """</para></td>"""
|
||||
for mat_col in range(0, len(menu_choices)):
|
||||
calc = 0
|
||||
response = 0
|
||||
for res in res_count:
|
||||
if res['answer_id'] == ans.id: response = res['count']
|
||||
for per in calc_percantage:
|
||||
if ans.id == per['answer_id'] and menu_choices[mat_col] == per['value_choice']:
|
||||
calc = per['count']
|
||||
percantage = 0.00
|
||||
|
||||
if calc and response:
|
||||
percantage = round((float(calc)* 100) / response,2)
|
||||
if calc:
|
||||
rml += """<td><para style="answer_bold">""" +tools.ustr(percantage)+"% (" + tools.ustr(calc) + """)</para></td>"""
|
||||
else:
|
||||
rml += """<td><para style="answer">""" +tools.ustr(percantage)+"% (" + tools.ustr(calc) + """)</para></td>"""
|
||||
|
||||
response = 0
|
||||
for res in res_count:
|
||||
if res['answer_id'] == ans.id: response = res['count']
|
||||
rml += """<td><para style="answer_right">""" + tools.ustr(response) + """</para></td></tr>"""
|
||||
rml += """</blockTable>"""
|
||||
|
||||
elif que.type in['numerical_textboxes']:
|
||||
rml += """<blockTable colWidths="240.0,20,100.0,70,70.0" style="Table1">
|
||||
<tr>
|
||||
|
||||
@@ -423,7 +423,7 @@ class survey_browse_response(report_rml):
|
||||
<tr> <td> <para style="response">No Answer</para></td> </tr>
|
||||
</blockTable>"""
|
||||
|
||||
elif que.type in ['matrix_of_choices_only_one_ans','matrix_of_choices_only_multi_ans', 'rating_scale', 'matrix_of_drop_down_menus']:
|
||||
elif que.type in ['matrix_of_choices_only_one_ans','matrix_of_choices_only_multi_ans', 'rating_scale']:
|
||||
if len(answer) and answer[0].state == "done":
|
||||
if que.type in ['matrix_of_choices_only_one_ans', 'rating_scale'] and que.comment_column:
|
||||
pass
|
||||
@@ -478,9 +478,7 @@ class survey_browse_response(report_rml):
|
||||
for res_ans in answer[0].response_answer_ids:
|
||||
if res_ans.answer_id.id == ans.id and res_ans.column_id.id == matrix_ans[mat_col][0]:
|
||||
comment_value = to_xml(tools.ustr(res_ans.comment_field))
|
||||
if que.type in ['matrix_of_drop_down_menus']:
|
||||
value = """<para style="response">""" + to_xml(tools.ustr(res_ans.value_choice)) + """</para>"""
|
||||
elif que.type in ['matrix_of_choices_only_one_ans', 'rating_scale']:
|
||||
if que.type in ['matrix_of_choices_only_one_ans', 'rating_scale']:
|
||||
value = """<illustration><fill color="white"/>
|
||||
<circle x="0.3cm" y="-0.18cm" radius="0.22 cm" fill="yes" stroke="yes"/>
|
||||
<fill color="gray"/>
|
||||
@@ -495,9 +493,7 @@ class survey_browse_response(report_rml):
|
||||
</illustration>"""
|
||||
break
|
||||
else:
|
||||
if que.type in ['matrix_of_drop_down_menus']:
|
||||
value = """"""
|
||||
elif que.type in ['matrix_of_choices_only_one_ans','rating_scale']:
|
||||
if que.type in ['matrix_of_choices_only_one_ans','rating_scale']:
|
||||
value = """<illustration><fill color="white"/>
|
||||
<circle x="0.3cm" y="-0.18cm" radius="0.22 cm" fill="yes" stroke="yes" round="0.1cm"/>
|
||||
</illustration>"""
|
||||
|
||||
@@ -244,7 +244,7 @@ class survey_form(report_rml):
|
||||
rml += """
|
||||
</tr></blockTable>"""
|
||||
|
||||
elif que.type in ['matrix_of_choices_only_one_ans','rating_scale','matrix_of_choices_only_multi_ans','matrix_of_drop_down_menus']:
|
||||
elif que.type in ['matrix_of_choices_only_one_ans','rating_scale','matrix_of_choices_only_multi_ans']:
|
||||
if len(que.column_heading_ids):
|
||||
cols_widhts.append(float(_tbl_widths.replace('cm',''))/float(2.0))
|
||||
for col in que.column_heading_ids:
|
||||
@@ -290,10 +290,7 @@ class survey_form(report_rml):
|
||||
rec_width = float((sum-tmp)*10+100)
|
||||
value = ""
|
||||
|
||||
if que.type in ['matrix_of_drop_down_menus']:
|
||||
value = """ <fill color="white"/>
|
||||
<rect x="-0.1cm" y="-0.45cm" width='""" + tools.ustr(cols_widhts[-1] - 0.5) +"cm" + """' height="0.5cm" fill="yes" stroke="yes" round="0.1cm"/>"""
|
||||
elif que.type in ['matrix_of_choices_only_one_ans','rating_scale']:
|
||||
if que.type in ['matrix_of_choices_only_one_ans','rating_scale']:
|
||||
value = """ <fill color="white"/>
|
||||
<circle x="0.35cm" y="-0.18cm" radius="0.25 cm" fill="yes" stroke="yes"/>"""
|
||||
else:
|
||||
|
||||
+5
-28
@@ -303,7 +303,6 @@ class survey_question(osv.osv):
|
||||
('multiple_choice_multiple_ans','Multiple Choice (Multiple Answer)'),
|
||||
('matrix_of_choices_only_one_ans','Matrix of Choices (Only One Answers Per Row)'),
|
||||
('matrix_of_choices_only_multi_ans','Matrix of Choices (Multiple Answers Per Row)'),
|
||||
('matrix_of_drop_down_menus','Matrix of Drop-down Menus'),
|
||||
('rating_scale','Rating Scale'),('single_textbox','Single Textbox'),
|
||||
('multiple_textboxes','Multiple Textboxes'),
|
||||
('multiple_textboxes_diff_type','Multiple Textboxes With Different Type'),
|
||||
@@ -388,10 +387,6 @@ class survey_question(osv.osv):
|
||||
val.update({'in_visible_rating_weight':False, 'in_visible_menu_choice':True})
|
||||
return {'value': val}
|
||||
|
||||
elif type in ['matrix_of_drop_down_menus']:
|
||||
val.update({'in_visible_rating_weight':True, 'in_visible_menu_choice':False})
|
||||
return {'value': val}
|
||||
|
||||
elif type in ['single_textbox']:
|
||||
val.update({'in_visible_rating_weight':True, 'in_visible_menu_choice':True})
|
||||
return {'value': val}
|
||||
@@ -418,8 +413,7 @@ class survey_question(osv.osv):
|
||||
else:
|
||||
que_type = question['type']
|
||||
|
||||
if que_type in ['matrix_of_choices_only_one_ans', 'matrix_of_choices_only_multi_ans',\
|
||||
'matrix_of_drop_down_menus', 'rating_scale']:
|
||||
if que_type in ['matrix_of_choices_only_one_ans', 'matrix_of_choices_only_multi_ans', 'rating_scale']:
|
||||
if not col_len:
|
||||
raise osv.except_osv(_('Warning!'),_('You must enter one or more column headings for question "%s" of page %s.') % (question['question'], question['page_id'][1]))
|
||||
ans_len = len(question['answer_choice_ids'])
|
||||
@@ -442,8 +436,8 @@ class survey_question(osv.osv):
|
||||
req_type = question['required_type']
|
||||
|
||||
if que_type in ['multiple_choice_multiple_ans','matrix_of_choices_only_one_ans', \
|
||||
'matrix_of_choices_only_multi_ans', 'matrix_of_drop_down_menus',\
|
||||
'rating_scale','multiple_textboxes','numerical_textboxes','date','date_and_time']:
|
||||
'matrix_of_choices_only_multi_ans', 'rating_scale','multiple_textboxes', \
|
||||
'numerical_textboxes','date','date_and_time']:
|
||||
if req_type in ['at least', 'at most', 'exactly']:
|
||||
if vals.has_key('req_ans'):
|
||||
if not vals['req_ans'] or vals['req_ans'] > ans_len:
|
||||
@@ -487,16 +481,6 @@ class survey_question(osv.osv):
|
||||
raise osv.except_osv(_('Warning!'),_("Maximum Required Answer is greater \
|
||||
than Minimum Required Answer"))
|
||||
|
||||
if question['type'] == 'matrix_of_drop_down_menus' and vals.has_key('column_heading_ids'):
|
||||
for col in vals['column_heading_ids']:
|
||||
if not col[2] or not col[2].has_key('menu_choice') or not col[2]['menu_choice']:
|
||||
raise osv.except_osv(_('Warning!'),_("You must enter one or more menu choices\
|
||||
in column heading."))
|
||||
elif not col[2] or not col[2].has_key('menu_choice') or\
|
||||
col[2]['menu_choice'].strip() == '':
|
||||
raise osv.except_osv(_('Warning!'),_("You must enter one or more menu \
|
||||
choices in column heading (white spaces not allowed)."))
|
||||
|
||||
return super(survey_question, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
@@ -508,10 +492,10 @@ class survey_question(osv.osv):
|
||||
raise osv.except_osv(_('Warning!'),_('You must enter one or more answers for question "%s" of page %s .') % (vals['question'], page))
|
||||
|
||||
if vals.has_key('column_heading_ids') and not len(vals['column_heading_ids']):
|
||||
if vals.has_key('type') and vals['type'] in ['matrix_of_choices_only_one_ans', 'matrix_of_choices_only_multi_ans', 'matrix_of_drop_down_menus', 'rating_scale']:
|
||||
if vals.has_key('type') and vals['type'] in ['matrix_of_choices_only_one_ans', 'matrix_of_choices_only_multi_ans', 'rating_scale']:
|
||||
raise osv.except_osv(_('Warning!'),_('You must enter one or more column headings for question "%s" of page %s.')% (vals['question'], page))
|
||||
|
||||
if vals['type'] in ['multiple_choice_multiple_ans','matrix_of_choices_only_one_ans', 'matrix_of_choices_only_multi_ans', 'matrix_of_drop_down_menus', 'rating_scale','multiple_textboxes','numerical_textboxes','date','date_and_time']:
|
||||
if vals['type'] in ['multiple_choice_multiple_ans','matrix_of_choices_only_one_ans', 'matrix_of_choices_only_multi_ans', 'rating_scale','multiple_textboxes','numerical_textboxes','date','date_and_time']:
|
||||
if vals.has_key('is_require_answer') and vals.has_key('required_type') and vals['required_type'] in ['at least', 'at most', 'exactly']:
|
||||
if vals.has_key('answer_choice_ids') and vals['req_ans'] > len(vals['answer_choice_ids']) or not vals['req_ans']:
|
||||
raise osv.except_osv(_('Warning!'),_("#Required Answer you entered is greater than the number of answer. Please use a number that is smaller than %d.") % (len(vals['answer_choice_ids'])+1))
|
||||
@@ -526,13 +510,6 @@ class survey_question(osv.osv):
|
||||
if maximum_ans <= minimum_ans:
|
||||
raise osv.except_osv(_('Warning!'),_("Maximum Required Answer is greater than Minimum Required Answer."))
|
||||
|
||||
if vals['type'] == 'matrix_of_drop_down_menus':
|
||||
for col in vals['column_heading_ids']:
|
||||
if not col[2] or not col[2].has_key('menu_choice') or not col[2]['menu_choice']:
|
||||
raise osv.except_osv(_('Warning!'),_("You must enter one or more menu choices in column heading."))
|
||||
elif not col[2] or not col[2].has_key('menu_choice') or col[2]['menu_choice'].strip() == '':
|
||||
raise osv.except_osv(_('Warning!'),_("You must enter one or more menu choices in column heading (white spaces not allowed)."))
|
||||
|
||||
res = super(survey_question, self).create(cr, uid, vals, context)
|
||||
return res
|
||||
|
||||
|
||||
@@ -82,11 +82,11 @@
|
||||
<field name="in_visible_answer_type" invisible="1"/>
|
||||
<notebook colspan="4">
|
||||
<page string="Options">
|
||||
<group attrs="{'invisible':[('type','!=','multiple_textboxes_diff_type'),('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','table')]}" string="Answer">
|
||||
<group attrs="{'invisible':[('type','!=','multiple_textboxes_diff_type'),('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','table')]}" string="Answer">
|
||||
<group colspan="4" attrs="{'invisible':[('type','=','table')]}">
|
||||
<field name="answer_choice_ids" nolabel="1" colspan="4" context="{'in_visible_answer_type': in_visible_answer_type}"/>
|
||||
</group>
|
||||
<group colspan="4" attrs="{'invisible':[('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','table')]}">
|
||||
<group colspan="4" attrs="{'invisible':[('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','rating_scale'),('type','!=','table')]}">
|
||||
<field name="column_heading_ids" colspan="4" nolabel="1" context="{'in_visible_rating_weight':in_visible_rating_weight,'in_visible_menu_choice':in_visible_menu_choice}"/>
|
||||
<group colspan="4" attrs="{'invisible':[('type','!=','table')]}">
|
||||
<field name="no_of_rows"/>
|
||||
@@ -94,7 +94,7 @@
|
||||
</group>
|
||||
</group>
|
||||
<newline/>
|
||||
<group attrs="{'invisible':[('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'), ('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale')]}">
|
||||
<group attrs="{'invisible':[('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'), ('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','rating_scale')]}">
|
||||
<separator string="Comment Field" colspan="4"/>
|
||||
<group colspan="4">
|
||||
<field name="is_comment_require"/>
|
||||
@@ -161,12 +161,12 @@
|
||||
</group>
|
||||
</group>
|
||||
<newline/>
|
||||
<group attrs="{'invisible':[('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','single_textbox'),('type','!=','comment'),('type','!=','multiple_textboxes_diff_type')]}">
|
||||
<group attrs="{'invisible':[('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','single_textbox'),('type','!=','comment'),('type','!=','multiple_textboxes_diff_type')]}">
|
||||
<separator string="Required Answer" colspan="4"/>
|
||||
<newline/>
|
||||
<field name="is_require_answer"/>
|
||||
<group col="6" colspan="4" attrs="{'invisible':[('is_require_answer','=',False)]}">
|
||||
<group colspan="4" attrs="{'invisible':[('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','multiple_textboxes_diff_type')]}">
|
||||
<group colspan="4" attrs="{'invisible':[('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','multiple_textboxes_diff_type')]}">
|
||||
<field name="required_type"/>
|
||||
<group colspan="2" attrs="{'invisible':[('required_type','!=','at least'),('required_type','!=','at most'),('required_type','!=','exactly')]}">
|
||||
<field name="req_ans" />
|
||||
@@ -318,7 +318,12 @@
|
||||
<t t-if="record.max_response_limit.raw_value > 0"> / <field name="max_response_limit"/></t>
|
||||
</div>
|
||||
<br/>
|
||||
<a name="fill_survey" type="object">Answer Survey</a>
|
||||
<ul>
|
||||
<li t-if="widget.view.is_action_enabled('edit')"><a type="edit">Edit Survey</a></li>
|
||||
<li t-if="widget.view.is_action_enabled('edit')"><a name="%(action_view_survey_send_invitation)d" type="action">Collect informations</a></li>
|
||||
<li><a name="fill_survey" type="object">Answer Survey</a></li>
|
||||
<li t-if="widget.view.is_action_enabled('edit')"><a>Analysis</a></li>
|
||||
</ul>
|
||||
<img t-att-src="kanban_image('res.users', 'image_small', record.responsible_id.raw_value)" t-att-title="record.responsible_id.value" width="24" height="24" class="oe_kanban_avatar oe_right"/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -395,11 +400,11 @@
|
||||
<newline/>
|
||||
<notebook colspan="4">
|
||||
<page string="Options">
|
||||
<group attrs="{'invisible':[('type','!=','multiple_textboxes_diff_type'),('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','table')]}" string="Answer" col="4">
|
||||
<group attrs="{'invisible':[('type','!=','multiple_textboxes_diff_type'),('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','table')]}" string="Answer" col="4">
|
||||
<group attrs="{'invisible':[('type','=','table')]}">
|
||||
<field name="answer_choice_ids" nolabel="1" context="{'in_visible_answer_type': in_visible_answer_type}"/>
|
||||
</group>
|
||||
<group attrs="{'invisible':[('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','table')]}">
|
||||
<group attrs="{'invisible':[('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','rating_scale'),('type','!=','table')]}">
|
||||
<field name="column_heading_ids" nolabel="1" context="{'in_visible_rating_weight':in_visible_rating_weight,'in_visible_menu_choice':in_visible_menu_choice}"/>
|
||||
<group attrs="{'invisible':[('type','!=','table')]}">
|
||||
<field name="no_of_rows"/>
|
||||
@@ -407,7 +412,7 @@
|
||||
</group>
|
||||
</group>
|
||||
<newline/>
|
||||
<group attrs="{'invisible':[('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'), ('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale')]}" string="Comment Field" col="4">
|
||||
<group attrs="{'invisible':[('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'), ('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','rating_scale')]}" string="Comment Field" col="4">
|
||||
<group>
|
||||
<field name="is_comment_require"/>
|
||||
</group>
|
||||
@@ -473,12 +478,12 @@
|
||||
</group>
|
||||
</group>
|
||||
<newline/>
|
||||
<group attrs="{'invisible':[('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','single_textbox'),('type','!=','comment'),('type','!=','multiple_textboxes_diff_type')]}">
|
||||
<group attrs="{'invisible':[('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','single_textbox'),('type','!=','comment'),('type','!=','multiple_textboxes_diff_type')]}">
|
||||
<separator string="Required Answer" colspan="4"/>
|
||||
<newline/>
|
||||
<field name="is_require_answer"/>
|
||||
<group col="6" colspan="4" attrs="{'invisible':[('is_require_answer','=',False)]}">
|
||||
<group colspan="4" attrs="{'invisible':[('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','multiple_textboxes_diff_type')]}">
|
||||
<group colspan="4" attrs="{'invisible':[('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','multiple_textboxes_diff_type')]}">
|
||||
<field name="required_type"/>
|
||||
<group colspan="2" attrs="{'invisible':[('required_type','!=','at least'),('required_type','!=','at most'),('required_type','!=','exactly')]}">
|
||||
<field name="req_ans" />
|
||||
@@ -603,12 +608,12 @@
|
||||
<field name="in_visible_answer_type" invisible="1"/>
|
||||
<notebook colspan="4">
|
||||
<page string="Options">
|
||||
<group attrs="{'invisible':[('type','!=','multiple_textboxes_diff_type'),('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','table')]}">
|
||||
<group attrs="{'invisible':[('type','!=','multiple_textboxes_diff_type'),('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','table')]}">
|
||||
<separator string="Answer" colspan="4"/>
|
||||
<group colspan="4" attrs="{'invisible':[('type','=','table')]}">
|
||||
<field name="answer_choice_ids" nolabel="1" colspan="4" context="{'in_visible_answer_type': in_visible_answer_type}"/>
|
||||
</group>
|
||||
<group colspan="4" attrs="{'invisible':[('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','table')]}">
|
||||
<group colspan="4" attrs="{'invisible':[('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','rating_scale'),('type','!=','table')]}">
|
||||
<field name="column_heading_ids" colspan="4" nolabel="1" context="{'in_visible_rating_weight':in_visible_rating_weight,'in_visible_menu_choice':in_visible_menu_choice}"/>
|
||||
<group colspan="4" attrs="{'invisible':[('type','!=','table')]}">
|
||||
<field name="no_of_rows"/>
|
||||
@@ -616,7 +621,7 @@
|
||||
</group>
|
||||
</group>
|
||||
<newline/>
|
||||
<group attrs="{'invisible':[('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'), ('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale')]}">
|
||||
<group attrs="{'invisible':[('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'), ('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','rating_scale')]}">
|
||||
<separator string="Comment Field" colspan="4"/>
|
||||
<group colspan="4">
|
||||
<field name="is_comment_require"/>
|
||||
@@ -683,12 +688,12 @@
|
||||
</group>
|
||||
</group>
|
||||
<newline/>
|
||||
<group attrs="{'invisible':[('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','single_textbox'),('type','!=','comment'),('type','!=','multiple_textboxes_diff_type')]}">
|
||||
<group attrs="{'invisible':[('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','single_textbox'),('type','!=','comment'),('type','!=','multiple_textboxes_diff_type')]}">
|
||||
<separator string="Required Answer" colspan="4"/>
|
||||
<newline/>
|
||||
<field name="is_require_answer"/>
|
||||
<group col="6" colspan="4" attrs="{'invisible':[('is_require_answer','=',False)]}">
|
||||
<group colspan="4" attrs="{'invisible':[('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','multiple_textboxes_diff_type')]}">
|
||||
<group colspan="4" attrs="{'invisible':[('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','multiple_textboxes_diff_type')]}">
|
||||
<field name="required_type"/>
|
||||
<group colspan="2" attrs="{'invisible':[('required_type','!=','at least'),('required_type','!=','at most'),('required_type','!=','exactly')]}">
|
||||
<field name="req_ans" />
|
||||
@@ -780,12 +785,12 @@
|
||||
<field name="in_visible_answer_type" invisible="1"/>
|
||||
<notebook colspan="4">
|
||||
<page string="Options">
|
||||
<group attrs="{'invisible':[('type','!=','multiple_textboxes_diff_type'),('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','table')]}">
|
||||
<group attrs="{'invisible':[('type','!=','multiple_textboxes_diff_type'),('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','table')]}">
|
||||
<separator string="Answer" colspan="4"/>
|
||||
<group colspan="4" attrs="{'invisible':[('type','=','table')]}">
|
||||
<field name="answer_choice_ids" nolabel="1" colspan="4" context="{'in_visible_answer_type': in_visible_answer_type}"/>
|
||||
</group>
|
||||
<group colspan="4" attrs="{'invisible':[('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','table')]}">
|
||||
<group colspan="4" attrs="{'invisible':[('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','rating_scale'),('type','!=','table')]}">
|
||||
<field name="column_heading_ids" colspan="4" nolabel="1" context="{'in_visible_rating_weight':in_visible_rating_weight,'in_visible_menu_choice':in_visible_menu_choice}"/>
|
||||
<group colspan="4" attrs="{'invisible':[('type','!=','table')]}">
|
||||
<field name="no_of_rows"/>
|
||||
@@ -793,7 +798,7 @@
|
||||
</group>
|
||||
</group>
|
||||
<newline/>
|
||||
<group attrs="{'invisible':[('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'), ('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale')]}">
|
||||
<group attrs="{'invisible':[('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'), ('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','rating_scale')]}">
|
||||
<separator string="Comment Field" colspan="4"/>
|
||||
<group colspan="4">
|
||||
<field name="is_comment_require"/>
|
||||
@@ -860,12 +865,12 @@
|
||||
</group>
|
||||
</group>
|
||||
<newline/>
|
||||
<group attrs="{'invisible':[('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','single_textbox'),('type','!=','comment'),('type','!=','multiple_textboxes_diff_type')]}">
|
||||
<group attrs="{'invisible':[('type','!=','multiple_choice_only_one_ans'), ('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','single_textbox'),('type','!=','comment'),('type','!=','multiple_textboxes_diff_type')]}">
|
||||
<separator string="Required Answer" colspan="4"/>
|
||||
<newline/>
|
||||
<field name="is_require_answer"/>
|
||||
<group col="6" colspan="4" attrs="{'invisible':[('is_require_answer','=',False)]}">
|
||||
<group colspan="4" attrs="{'invisible':[('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','matrix_of_drop_down_menus'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','multiple_textboxes_diff_type')]}">
|
||||
<group colspan="4" attrs="{'invisible':[('type','!=','multiple_choice_multiple_ans'),('type','!=','matrix_of_choices_only_one_ans'),('type','!=','matrix_of_choices_only_multi_ans'),('type','!=','rating_scale'),('type','!=','multiple_textboxes'),('type','!=','numerical_textboxes'),('type','!=','date'),('type','!=','date_and_time'),('type','!=','multiple_textboxes_diff_type')]}">
|
||||
<field name="required_type"/>
|
||||
<group colspan="2" attrs="{'invisible':[('required_type','!=','at least'),('required_type','!=','at most'),('required_type','!=','exactly')]}">
|
||||
<field name="req_ans" />
|
||||
@@ -1037,25 +1042,6 @@
|
||||
Survey Response Answer
|
||||
-->
|
||||
|
||||
<record model="ir.ui.view" id="survey_response_answer_form">
|
||||
<field name="name">survey_response_answer_form</field>
|
||||
<field name="model">survey.response.answer</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Survey Answer">
|
||||
<group colspan="4">
|
||||
<field name="answer_id"/>
|
||||
<field name="answer" />
|
||||
</group>
|
||||
<field name="value_choice"/>
|
||||
<label string="(Use Only Question Type is matrix_of_drop_down_menus)" align="0.0"/>
|
||||
<group colspan="4" col="4">
|
||||
<field name="comment_field"/>
|
||||
<field name="column_id"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="survey_response_answer_tree">
|
||||
<field name="name">survey_response_answer_tree</field>
|
||||
<field name="model">survey.response.answer</field>
|
||||
|
||||
@@ -257,21 +257,6 @@ class survey_question_wiz(osv.osv_memory):
|
||||
etree.SubElement(xml_group, 'field', {'readonly' :str(readonly), 'name': tools.ustr(que.id) + "_" + tools.ustr(row.id) + "_" + tools.ustr(col.id), 'nolabel':"1"})
|
||||
fields[tools.ustr(que.id) + "_" + tools.ustr(row.id) + "_" + tools.ustr(col.id)] = {'type':'boolean', 'string': col.title}
|
||||
|
||||
elif que_rec.type == 'matrix_of_drop_down_menus':
|
||||
xml_group = etree.SubElement(xml_group, 'group', {'col': str(len(que_rec.column_heading_ids) + 1), 'colspan': '4'})
|
||||
etree.SubElement(xml_group, 'separator', {'string': '.','colspan': '1'})
|
||||
for col in que_rec.column_heading_ids:
|
||||
etree.SubElement(xml_group, 'separator', {'string': tools.ustr(col.title),'colspan': '1'})
|
||||
for row in ans_ids:
|
||||
etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr(row.answer))+' :-', 'align': '0.0'})
|
||||
for col in que_rec.column_heading_ids:
|
||||
selection = []
|
||||
if col.menu_choice:
|
||||
for item in col.menu_choice.split('\n'):
|
||||
if item and not item.strip() == '': selection.append((item ,item))
|
||||
etree.SubElement(xml_group, 'field', {'readonly' :str(readonly), 'name': tools.ustr(que.id) + "_" + tools.ustr(row.id) + "_" + tools.ustr(col.id),'nolabel':'1'})
|
||||
fields[tools.ustr(que.id) + "_" + tools.ustr(row.id) + "_" + tools.ustr(col.id)] = {'type':'selection', 'string': col.title, 'selection':selection}
|
||||
|
||||
elif que_rec.type == 'multiple_textboxes':
|
||||
xml_group = etree.SubElement(xml_group, 'group', {'col': '4', 'colspan': '4'})
|
||||
type = "char"
|
||||
@@ -348,7 +333,7 @@ class survey_question_wiz(osv.osv_memory):
|
||||
if item and not item.strip() == '': selection.append((item ,item))
|
||||
fields[tools.ustr(que.id) + "_" + tools.ustr(ans.id) + "_multi"] = {'type':'selection', 'selection' : selection, 'string':ans.answer}
|
||||
|
||||
if que_rec.type in ['multiple_choice_only_one_ans', 'multiple_choice_multiple_ans', 'matrix_of_choices_only_one_ans', 'matrix_of_choices_only_multi_ans', 'matrix_of_drop_down_menus', 'rating_scale'] and que_rec.is_comment_require:
|
||||
if que_rec.type in ['multiple_choice_only_one_ans', 'multiple_choice_multiple_ans', 'matrix_of_choices_only_one_ans', 'matrix_of_choices_only_multi_ans', 'rating_scale'] and que_rec.is_comment_require:
|
||||
if que_rec.type in ['multiple_choice_only_one_ans', 'multiple_choice_multiple_ans'] and que_rec.comment_field_type in ['char','text'] and que_rec.make_comment_field:
|
||||
etree.SubElement(xml_group, 'field', {'readonly' :str(readonly), 'name': tools.ustr(que.id) + "_otherfield", 'colspan':"4"})
|
||||
fields[tools.ustr(que.id) + "_otherfield"] = {'type':'boolean', 'string':que_rec.comment_label, 'views':{}}
|
||||
@@ -807,7 +792,7 @@ class survey_question_wiz(osv.osv_memory):
|
||||
sur_name_read['store_ans'].pop(res)
|
||||
raise osv.except_osv(_('Warning!'), "'" + que_rec['question'] + "' " + tools.ustr(que_rec['numeric_required_sum_err_msg']))
|
||||
|
||||
if que_rec['type'] in ['multiple_textboxes_diff_type', 'multiple_choice_multiple_ans','matrix_of_choices_only_one_ans','matrix_of_choices_only_multi_ans','matrix_of_drop_down_menus','rating_scale','multiple_textboxes','numerical_textboxes','date','date_and_time'] and que_rec['is_require_answer']:
|
||||
if que_rec['type'] in ['multiple_textboxes_diff_type', 'multiple_choice_multiple_ans','matrix_of_choices_only_one_ans','matrix_of_choices_only_multi_ans','rating_scale','multiple_textboxes','numerical_textboxes','date','date_and_time'] and que_rec['is_require_answer']:
|
||||
if matrix_list:
|
||||
if (que_rec['required_type'] == 'all' and len(list(set(matrix_list))) < len(que_rec['answer_choice_ids'])) or \
|
||||
(que_rec['required_type'] == 'at least' and len(list(set(matrix_list))) < que_rec['req_ans']) or \
|
||||
@@ -997,7 +982,7 @@ class survey_question_wiz(osv.osv_memory):
|
||||
if not select_count:
|
||||
resp_obj.write(cr, uid, update, {'state': 'skip'})
|
||||
|
||||
if que_rec['type'] in ['multiple_textboxes_diff_type','multiple_choice_multiple_ans','matrix_of_choices_only_one_ans','matrix_of_choices_only_multi_ans','matrix_of_drop_down_menus','rating_scale','multiple_textboxes','numerical_textboxes','date','date_and_time'] and que_rec['is_require_answer']:
|
||||
if que_rec['type'] in ['multiple_textboxes_diff_type','multiple_choice_multiple_ans','matrix_of_choices_only_one_ans','matrix_of_choices_only_multi_ans','rating_scale','multiple_textboxes','numerical_textboxes','date','date_and_time'] and que_rec['is_require_answer']:
|
||||
if matrix_list:
|
||||
if (que_rec['required_type'] == 'all' and len(list(set(matrix_list))) < len(que_rec['answer_choice_ids'])) or \
|
||||
(que_rec['required_type'] == 'at least' and len(list(set(matrix_list))) < que_rec['req_ans']) or \
|
||||
|
||||
Reference in New Issue
Block a user