[IMP] survey: statistics
bzr revid: chm@openerp.com-20130222100950-8ica4v4bpx4nbdvu
This commit is contained in:
@@ -38,7 +38,6 @@ user name and password for the invitation of the survey.
|
||||
'data': [
|
||||
'survey_report.xml',
|
||||
'survey_data.xml',
|
||||
'wizard/survey_selection.xml',
|
||||
'wizard/survey_answer.xml',
|
||||
'security/survey_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
@@ -48,6 +47,7 @@ user name and password for the invitation of the survey.
|
||||
'wizard/survey_browse_answer.xml',
|
||||
'wizard/survey_print.xml',
|
||||
'wizard/survey_email_compose_message.xml',
|
||||
#'wizard/survey_selection.xml',
|
||||
],
|
||||
'demo': ['survey_demo.xml'],
|
||||
'test': [
|
||||
|
||||
@@ -239,16 +239,16 @@ class survey_analysis(report_rml):
|
||||
rml += """</blockTable>"""
|
||||
|
||||
if que.is_comment_require:
|
||||
# if que.make_comment_field:
|
||||
# cr.execute("select count(id) from survey_response_line where question_id = %s and comment != ''", (que.id,))
|
||||
# tot_res = cr.fetchone()[0]
|
||||
# tot_avg = 0.00
|
||||
# if que.tot_resp:
|
||||
# tot_avg = round(float(tot_res * 100)/ que.tot_resp,2)
|
||||
# rml+="""<blockTable colWidths="280.0,120,100.0" style="Table1"><tr><td><para style="answer">""" +to_xml(tools.ustr(que.comment_label)) + """</para></td>
|
||||
# <td><para style="answer">""" + str(tot_avg) + """%</para></td>
|
||||
# <td><para style="answer">""" + tools.ustr(tot_res) + """</para></td></tr></blockTable>"""
|
||||
# else:
|
||||
# if que.make_comment_field:
|
||||
# cr.execute("select count(id) from survey_response_line where question_id = %s and comment != ''", (que.id,))
|
||||
# tot_res = cr.fetchone()[0]
|
||||
# tot_avg = 0.00
|
||||
# if que.tot_resp:
|
||||
# tot_avg = round(float(tot_res * 100)/ que.tot_resp,2)
|
||||
# rml+="""<blockTable colWidths="280.0,120,100.0" style="Table1"><tr><td><para style="answer">""" +to_xml(tools.ustr(que.comment_label)) + """</para></td>
|
||||
# <td><para style="answer">""" + str(tot_avg) + """%</para></td>
|
||||
# <td><para style="answer">""" + tools.ustr(tot_res) + """</para></td></tr></blockTable>"""
|
||||
# else:
|
||||
cr.execute("select count(id) from survey_response_line where question_id = %s and comment != ''", (que.id,))
|
||||
tot_res = cr.fetchone()[0]
|
||||
rml += """<blockTable colWidths="450.0,50.0" style="Table1"><tr><td><para style="answer_right">""" + to_xml(tools.ustr(que.comment_label)) + """</para></td>
|
||||
@@ -304,7 +304,7 @@ class survey_analysis(report_rml):
|
||||
cr.execute("select count(sra.answer_id),sqc.rating_weight from survey_response_line sr, survey_response_answer sra ,\
|
||||
survey_question_column_heading sqc where sr.id = sra.response_id and \
|
||||
sqc.question_id = sr.question_id and sra.answer_id = %s and sqc.title ='%s'\
|
||||
+ group by sra.answer_id,sqc.rating_weight", (ans.id,matrix_ans[mat_col][1]))
|
||||
group by sra.answer_id,sqc.rating_weight", (ans.id,matrix_ans[mat_col][1]))
|
||||
col_weight = cr.fetchone()
|
||||
|
||||
if not col_weight:
|
||||
|
||||
+27
-10
@@ -173,6 +173,23 @@ class survey(osv.osv):
|
||||
}
|
||||
return report
|
||||
|
||||
def print_statistics(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
Print Survey Statistics in pdf format.
|
||||
"""
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'survey.analysis',
|
||||
'datas': {
|
||||
'model': 'survey.print.statistics',
|
||||
'ids': [],
|
||||
'form': {
|
||||
'id': None,
|
||||
'survey_ids': ids
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
def _check_valid(self, cr, uid, ids, context=None):
|
||||
sur_browse = self.browse(cr, uid, ids[0], context=context)
|
||||
if not sur_browse.page_ids:
|
||||
@@ -182,14 +199,15 @@ class survey(osv.osv):
|
||||
self._check_valid(cr, uid, ids, context=context)
|
||||
|
||||
id = ids[0]
|
||||
context.update({'active': False, 'survey_id': id})
|
||||
survey = self.browse(cr, uid, id, context=context)
|
||||
context.update({'edit': False, 'survey_id': id, 'survey_token': survey.token})
|
||||
return {
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'survey.question.wiz',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'inline',
|
||||
'name': self.browse(cr, uid, id, context=context).title,
|
||||
'name': survey.title,
|
||||
'context': context
|
||||
}
|
||||
|
||||
@@ -197,7 +215,6 @@ class survey(osv.osv):
|
||||
id = ids[0]
|
||||
context.update({
|
||||
'survey_id': id,
|
||||
'active': True,
|
||||
'edit': True,
|
||||
'ir_actions_act_window_target': 'new',
|
||||
})
|
||||
@@ -392,18 +409,18 @@ class survey_question(osv.osv):
|
||||
}
|
||||
_defaults = {
|
||||
'sequence': 1,
|
||||
'type': 'multiple_choice_multiple_ans',
|
||||
'req_error_msg': 'This question requires an answer.',
|
||||
'type': lambda s, cr, uid, c: _('multiple_choice_multiple_ans'),
|
||||
'req_error_msg': lambda s, cr, uid, c: _('This question requires an answer.'),
|
||||
'required_type': 'at least',
|
||||
'req_ans': 1,
|
||||
'comment_field_type': 'char',
|
||||
'comment_label': 'Other (please specify)',
|
||||
'comment_label': lambda s, cr, uid, c: _('Other (please specify)'),
|
||||
'comment_valid_type': 'do_not_validate',
|
||||
'comment_valid_err_msg': 'The comment you entered is in an invalid format.',
|
||||
'comment_valid_err_msg': lambda s, cr, uid, c: _('The comment you entered is in an invalid format.'),
|
||||
'validation_type': 'do_not_validate',
|
||||
'validation_valid_err_msg': 'The comment you entered is in an invalid format.',
|
||||
'numeric_required_sum_err_msg': 'The choices need to add up to [enter sum here].',
|
||||
'make_comment_field_err_msg': 'Please enter a comment.',
|
||||
'validation_valid_err_msg': lambda s, cr, uid, c: _('The comment you entered is in an invalid format.'),
|
||||
'numeric_required_sum_err_msg': lambda s, cr, uid, c: _('The choices need to add up to [enter sum here].'),
|
||||
'make_comment_field_err_msg': lambda s, cr, uid, c: _('Please enter a comment.'),
|
||||
'in_visible_answer_type': 1
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
|
||||
<menuitem name="Surveys" id="menu_surveys" parent="base.menu_tools" sequence="2" groups="base.group_tool_user,base.group_tool_manager,base.group_survey_user"/>
|
||||
|
||||
<menuitem name="Configuration" id="menu_surveys_configuration" parent="base.menu_tools" sequence="3" groups="base.group_tool_manager"/>
|
||||
<menuitem name="Configuration" id="menu_surveys_configuration" parent="menu_surveys" sequence="3" groups="base.group_tool_manager"/>
|
||||
|
||||
<menuitem name="Analysis" id="menu_surveys_analyze" parent="menu_surveys" sequence="4" groups="base.group_tool_manager"/>
|
||||
|
||||
<menuitem name="Reporting" parent="base.menu_tools"
|
||||
id="base.menu_lunch_reporting" sequence="6"/>
|
||||
@@ -227,9 +229,9 @@
|
||||
<field name="tot_comp_survey" string="Completed"/>
|
||||
<field name="state"/>
|
||||
<button name="fill_survey" states="open"
|
||||
string="Answer Survey" type="object" icon="gtk-execute" context="{'survey_id': active_id}" attrs="{'invisible':[('state','!=','open')]}"/>
|
||||
<button name="action_print_survey" states="open,draft,close,cancel"
|
||||
string="Print Answer" type="object" icon="gtk-print"/>
|
||||
string="Fill in survey" type="object" icon="gtk-execute" context="{'survey_id': active_id}" attrs="{'invisible':[('state','!=','open')]}"/>
|
||||
<button name="action_print_survey" string="Print Answer" type="object" icon="gtk-print"/>
|
||||
<button name="print_statistics" string="Print Statistics" states="open,close,cancel" type="object" icon="gtk-print"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -294,8 +296,8 @@
|
||||
<ul>
|
||||
<li t-if="widget.view.is_action_enabled('edit')"><a name="edit_survey" string="Edit Survey" type="object">Edit Survey</a></li>
|
||||
<li t-if="record.state.raw_value === 'open' and widget.view.is_action_enabled('edit')"><a name="action_survey_sent" type="object">Collect responses</a></li>
|
||||
<li><a t-if="record.state.raw_value === 'open'" name="fill_survey" type="object">Answer Survey</a></li>
|
||||
<li t-if="record.tot_comp_survey.raw_value and widget.view.is_action_enabled('edit')"><a>Analyze responses</a></li>
|
||||
<li><a t-if="record.state.raw_value === 'open'" name="fill_survey" type="object">Fill in survey</a></li>
|
||||
<li t-if="record.tot_comp_survey.raw_value and widget.view.is_action_enabled('edit')"><a name="print_statistics" type="object">Print Statistics</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -38,7 +38,7 @@ class survey_question_wiz(osv.osv_memory):
|
||||
'name': fields.integer('Number'),
|
||||
}
|
||||
|
||||
def _view_field_multiple_choice_only_one_ans(self, cr, uid, xml_group, fields, readonly, que, que_rec):
|
||||
def _view_field_multiple_choice_only_one_ans(self, cr, uid, xml_group, fields, readonly, que, que_rec, context=None):
|
||||
selection = []
|
||||
for ans in que_rec.answer_choice_ids:
|
||||
selection.append((tools.ustr(ans.id), ans.answer))
|
||||
@@ -46,14 +46,14 @@ class survey_question_wiz(osv.osv_memory):
|
||||
etree.SubElement(xml_group, 'field', {'readonly': str(readonly), 'name': tools.ustr(que.id) + "_selection"})
|
||||
fields[tools.ustr(que.id) + "_selection"] = {'type': 'selection', 'selection': selection, 'string': "Answer"}
|
||||
|
||||
def _view_field_multiple_choice_multiple_ans(self, cr, uid, xml_group, fields, readonly, que, que_rec):
|
||||
def _view_field_multiple_choice_multiple_ans(self, cr, uid, xml_group, fields, readonly, que, que_rec, context=None):
|
||||
# TODO convert selection field into radio input
|
||||
xml_group = etree.SubElement(xml_group, 'group', {'col': '4', 'colspan': '4'})
|
||||
for ans in que_rec.answer_choice_ids:
|
||||
etree.SubElement(xml_group, 'field', {'readonly': str(readonly), 'name': tools.ustr(que.id) + "_" + tools.ustr(ans.id)})
|
||||
fields[tools.ustr(que.id) + "_" + tools.ustr(ans.id)] = {'type': 'boolean', 'string': ans.answer}
|
||||
|
||||
def _view_field_matrix_of_choices_only_multi_ans(self, cr, uid, xml_group, fields, readonly, que, que_rec):
|
||||
def _view_field_matrix_of_choices_only_multi_ans(self, cr, uid, xml_group, fields, readonly, que, que_rec, context=None):
|
||||
que_col_head = self.pool.get('survey.question.column.heading')
|
||||
|
||||
xml_group = etree.SubElement(xml_group, 'group', {'col': str(len(que_rec.column_heading_ids) + 1), 'colspan': '4'})
|
||||
@@ -66,7 +66,7 @@ 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}
|
||||
|
||||
def _view_field_multiple_textboxes(self, cr, uid, xml_group, fields, readonly, que, que_rec):
|
||||
def _view_field_multiple_textboxes(self, cr, uid, xml_group, fields, readonly, que, que_rec, context=None):
|
||||
xml_group = etree.SubElement(xml_group, 'group', {'col': '4', 'colspan': '4'})
|
||||
type = "char"
|
||||
if que_rec.is_validation_require:
|
||||
@@ -80,38 +80,38 @@ class survey_question_wiz(osv.osv_memory):
|
||||
etree.SubElement(xml_group, 'field', {'readonly': str(readonly), 'width': "300", 'colspan': '1', 'name': tools.ustr(que.id) + "_" + tools.ustr(ans.id) + "_multi"})
|
||||
fields[tools.ustr(que.id) + "_" + tools.ustr(ans.id) + "_multi"] = {'type': str(type), 'string': ans.answer}
|
||||
|
||||
def _view_field_numerical_textboxes(self, cr, uid, xml_group, fields, readonly, que, que_rec):
|
||||
def _view_field_numerical_textboxes(self, cr, uid, xml_group, fields, readonly, que, que_rec, context=None):
|
||||
xml_group = etree.SubElement(xml_group, 'group', {'col': '4', 'colspan': '4'})
|
||||
for ans in que_rec.answer_choice_ids:
|
||||
etree.SubElement(xml_group, 'field', {'readonly': str(readonly), 'width': "300", 'colspan': '1', 'name': tools.ustr(que.id) + "_" + tools.ustr(ans.id) + "_numeric"})
|
||||
fields[tools.ustr(que.id) + "_" + tools.ustr(ans.id) + "_numeric"] = {'type': 'integer', 'string': ans.answer}
|
||||
|
||||
def _view_field_date(self, cr, uid, xml_group, fields, readonly, que, que_rec):
|
||||
def _view_field_date(self, cr, uid, xml_group, fields, readonly, que, que_rec, context=None):
|
||||
xml_group = etree.SubElement(xml_group, 'group', {'col': '4', 'colspan': '4'})
|
||||
for ans in que_rec.answer_choice_ids:
|
||||
etree.SubElement(xml_group, 'field', {'readonly': str(readonly), 'width': "300", 'colspan': '1', 'name': tools.ustr(que.id) + "_" + tools.ustr(ans.id)})
|
||||
fields[tools.ustr(que.id) + "_" + tools.ustr(ans.id)] = {'type': 'date', 'string': ans.answer}
|
||||
|
||||
def _view_field_date_and_time(self, cr, uid, xml_group, fields, readonly, que, que_rec):
|
||||
def _view_field_date_and_time(self, cr, uid, xml_group, fields, readonly, que, que_rec, context=None):
|
||||
xml_group = etree.SubElement(xml_group, 'group', {'col': '4', 'colspan': '4'})
|
||||
for ans in que_rec.answer_choice_ids:
|
||||
etree.SubElement(xml_group, 'field', {'readonly': str(readonly), 'width': "300", 'colspan': '1', 'name': tools.ustr(que.id) + "_" + tools.ustr(ans.id)})
|
||||
fields[tools.ustr(que.id) + "_" + tools.ustr(ans.id)] = {'type': 'datetime', 'string': ans.answer}
|
||||
|
||||
def _view_field_descriptive_text(self, cr, uid, xml_group, fields, readonly, que, que_rec):
|
||||
def _view_field_descriptive_text(self, cr, uid, xml_group, fields, readonly, que, que_rec, context=None):
|
||||
if que_rec.descriptive_text:
|
||||
for que_test in que_rec.descriptive_text.split('\n'):
|
||||
etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr(que_test)), 'align': "0.0"})
|
||||
|
||||
def _view_field_single_textbox(self, cr, uid, xml_group, fields, readonly, que, que_rec):
|
||||
def _view_field_single_textbox(self, cr, uid, xml_group, fields, readonly, que, que_rec, context=None):
|
||||
etree.SubElement(xml_group, 'field', {'readonly': str(readonly), 'name': tools.ustr(que.id) + "_single", 'nolabel': "1", 'colspan': "4"})
|
||||
fields[tools.ustr(que.id) + "_single"] = {'type': 'char', 'size': 255, 'string': "single_textbox", 'views': {}}
|
||||
|
||||
def _view_field_comment(self, cr, uid, xml_group, fields, readonly, que, que_rec):
|
||||
def _view_field_comment(self, cr, uid, xml_group, fields, readonly, que, que_rec, context=None):
|
||||
etree.SubElement(xml_group, 'field', {'readonly': str(readonly), 'name': tools.ustr(que.id) + "_comment", 'nolabel': "1", 'colspan': "4"})
|
||||
fields[tools.ustr(que.id) + "_comment"] = {'type': 'text', 'string': "Comment/Eassy Box", 'views': {}}
|
||||
|
||||
def _view_field_table(self, cr, uid, xml_group, fields, readonly, que, que_rec):
|
||||
def _view_field_table(self, cr, uid, xml_group, fields, readonly, que, que_rec, context=None):
|
||||
xml_group = etree.SubElement(xml_group, 'group', {'col': str(len(que_rec.column_heading_ids)), 'colspan': '4'})
|
||||
for col in que_rec.column_heading_ids:
|
||||
etree.SubElement(xml_group, 'separator', {'string': tools.ustr(col.title), 'colspan': '1'})
|
||||
@@ -120,7 +120,7 @@ class survey_question_wiz(osv.osv_memory):
|
||||
etree.SubElement(xml_group, 'field', {'readonly': str(readonly), 'name': tools.ustr(que.id) + "_table_" + tools.ustr(col.id) + "_" + tools.ustr(row), 'nolabel': "1"})
|
||||
fields[tools.ustr(que.id) + "_table_" + tools.ustr(col.id) + "_" + tools.ustr(row)] = {'type': 'char', 'size': 255, 'views': {}}
|
||||
|
||||
def _view_field_multiple_textboxes_diff_type(self, cr, uid, xml_group, fields, readonly, que, que_rec):
|
||||
def _view_field_multiple_textboxes_diff_type(self, cr, uid, xml_group, fields, readonly, que, que_rec, context=None):
|
||||
xml_group = etree.SubElement(xml_group, 'group', {'col': '4', 'colspan': '4'})
|
||||
for ans in que_rec.answer_choice_ids:
|
||||
if ans.type == "email":
|
||||
@@ -140,7 +140,7 @@ class survey_question_wiz(osv.osv_memory):
|
||||
selection.append((item, item))
|
||||
fields[tools.ustr(que.id) + "_" + tools.ustr(ans.id) + "_multi"] = {'type': 'selection', 'selection': selection, 'string': ans.answer}
|
||||
|
||||
def _view_field_matrix_of_choices_only_one_ans(self, cr, uid, xml_group, fields, readonly, que, que_rec):
|
||||
def _view_field_matrix_of_choices_only_one_ans(self, cr, uid, xml_group, fields, readonly, que, que_rec, context=None):
|
||||
if que_rec.comment_column:
|
||||
col = "4"
|
||||
colspan = "4"
|
||||
@@ -159,10 +159,10 @@ class survey_question_wiz(osv.osv_memory):
|
||||
fields[tools.ustr(que.id) + "_commentcolumn_" + tools.ustr(row.id) + "_field"] = {'type': 'char', 'size': 255, 'string': tools.ustr(que_rec.column_name), 'views': {}}
|
||||
etree.SubElement(xml_group, 'field', {'readonly': str(readonly), 'name': tools.ustr(que.id) + "_commentcolumn_" + tools.ustr(row.id) + "_field"})
|
||||
|
||||
def _view_field_rating_scale(self, cr, uid, xml_group, fields, readonly, que, que_rec):
|
||||
def _view_field_rating_scale(self, cr, uid, xml_group, fields, readonly, que, que_rec, context=None):
|
||||
self._view_field_matrix_of_choices_only_one_ans(xml_group, fields, readonly, que, que_rec)
|
||||
|
||||
def _view_field_postprocessing(self, cr, uid, xml_group, fields, readonly, que, que_rec):
|
||||
def _view_field_postprocessing(self, cr, uid, xml_group, fields, readonly, que, que_rec, context=None):
|
||||
# after matrix of choices
|
||||
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"})
|
||||
@@ -210,12 +210,22 @@ class survey_question_wiz(osv.osv_memory):
|
||||
if not survey_id:
|
||||
raise osv.except_osv(_('Warning!'), _("You do not have access to this survey."))
|
||||
|
||||
survey_browse = self.pool.get('survey').browse(cr, uid, survey_id, context=context)
|
||||
survey_obj = self.pool.get('survey')
|
||||
survey_browse = survey_obj.browse(cr, uid, survey_id, context=context)
|
||||
user_browse = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
||||
pid = user_browse.partner_id.id
|
||||
model_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'portal', 'group_anonymous')
|
||||
anonymous = model_id and model_id[1] in [x.id for x in user_browse.groups_id]
|
||||
|
||||
# to do: check if context.get('edit') is allow
|
||||
if context.get('edit'):
|
||||
try:
|
||||
survey_obj.check_access_rights(cr, uid, 'write')
|
||||
survey_obj.check_access_rule(cr, uid, [survey_id], 'write', context=context)
|
||||
except except_orm, e:
|
||||
context['edit'] = False
|
||||
|
||||
# check open and sign in
|
||||
if not context.get('edit') and survey_browse.state != "open":
|
||||
raise osv.except_osv(_('Warning!'), _("You cannot answer because the survey is not open."))
|
||||
if anonymous and survey_browse.sign_in:
|
||||
@@ -343,7 +353,7 @@ class survey_question_wiz(osv.osv_memory):
|
||||
|
||||
# have acces to this survey
|
||||
if not check_token['error_message']:
|
||||
active = context.get('active', False)
|
||||
active = context.get('edit', False)
|
||||
|
||||
if sur_name_read.page == "next" or sur_name_rec.page_no == -1:
|
||||
if total_pages > sur_name_rec.page_no + 1:
|
||||
@@ -415,9 +425,9 @@ class survey_question_wiz(osv.osv_memory):
|
||||
xml_group = etree.SubElement(xml_form, 'group', {'col': '1', 'colspan': '4'})
|
||||
|
||||
# rendering different views
|
||||
getattr(self, "_view_field_%s" % que_rec.type)(cr, uid, xml_group, fields, readonly, que, que_rec)
|
||||
getattr(self, "_view_field_%s" % que_rec.type)(cr, uid, xml_group, fields, readonly, que, que_rec, context=context)
|
||||
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:
|
||||
self._view_field_postprocessing(cr, uid, xml_group, fields, readonly, que, que_rec)
|
||||
self._view_field_postprocessing(cr, uid, xml_group, fields, readonly, que, que_rec, context=context)
|
||||
|
||||
xml_footer = etree.SubElement(xml_form, 'footer', {'col': '8', 'colspan': '1', 'width': "100%"})
|
||||
|
||||
@@ -547,7 +557,7 @@ class survey_question_wiz(osv.osv_memory):
|
||||
else:
|
||||
if not context.get('sur_name_id'):
|
||||
return value
|
||||
if context.get('active', False):
|
||||
if context.get('edit', False):
|
||||
return value
|
||||
|
||||
surv_name_wiz = self.pool.get('survey.name.wiz')
|
||||
@@ -570,7 +580,7 @@ class survey_question_wiz(osv.osv_memory):
|
||||
return False
|
||||
|
||||
survey_question_wiz_id = super(survey_question_wiz, self).create(cr, uid, {'name': vals.get('name')}, context=context)
|
||||
if context.get('active', False):
|
||||
if context.get('edit', False):
|
||||
return survey_question_wiz_id
|
||||
|
||||
for key, val in vals.items():
|
||||
|
||||
@@ -38,5 +38,9 @@
|
||||
action="action_browse_survey_response" parent="base.next_id_10"
|
||||
groups="base.group_tool_manager" icon="STOCK_PRINT_PREVIEW"/>
|
||||
|
||||
<menuitem name="Browse Answers" id="menu_survey_browse_survey_response"
|
||||
action="action_browse_survey_response" parent="menu_surveys_analyze"
|
||||
groups="base.group_tool_manager"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</p>
|
||||
<p>Thank you for choosing us!</p>
|
||||
</div>
|
||||
]]></field>
|
||||
]]></field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="survey_email_compose_message">
|
||||
|
||||
@@ -41,5 +41,8 @@
|
||||
<menuitem name="Surveys Answers" action="action_view_survey_print_answer" id="menu_print_survey_answer"
|
||||
parent="base.next_id_10" icon="STOCK_PRINT" groups="base.group_tool_manager"/>
|
||||
|
||||
<menuitem name="Surveys Answers" action="action_view_survey_print_answer" id="menu_print_survey_answer"
|
||||
parent="menu_surveys_analyze" groups="base.group_tool_manager"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -39,6 +39,7 @@ class survey_print_statistics(osv.osv_memory):
|
||||
res = res and res[0] or {}
|
||||
datas['form'] = res
|
||||
datas['model'] = 'survey.print.statistics'
|
||||
print datas
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'survey.analysis',
|
||||
|
||||
@@ -33,5 +33,8 @@
|
||||
<menuitem name="Surveys Statistics" action="action_view_survey_print_statistics" id="menu_print_survey_statistics"
|
||||
parent="base.next_id_10" icon="STOCK_PRINT" groups="base.group_tool_manager"/>
|
||||
|
||||
<menuitem name="Surveys Statistics" action="action_view_survey_print_statistics" id="menu_survey_print_survey_statistics"
|
||||
parent="menu_surveys_analyze" groups="base.group_tool_manager"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
Display Survey List
|
||||
-->
|
||||
|
||||
<!--record id="view_survey_name" model="ir.ui.view">
|
||||
<record id="view_survey_name" model="ir.ui.view">
|
||||
<field name="name">Survey</field>
|
||||
<field name="model">survey.name.wiz</field>
|
||||
<field name="arch" type="xml">
|
||||
@@ -16,7 +16,7 @@
|
||||
<button string="Cancel" class="oe_link" special="cancel" />
|
||||
</header>
|
||||
<group>
|
||||
<field name="survey_id" on_change="on_change_survey(survey_id)"/>
|
||||
<field name="survey_id"/>
|
||||
</group>
|
||||
<field name="note" placeholder="Add Description" attrs="{'readonly': [('survey_id','=',False)]}"/>
|
||||
</form>
|
||||
@@ -30,6 +30,11 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record-->
|
||||
</record>
|
||||
|
||||
<menuitem name="Give Survey Answer" id="menu_survey_name_wiz"
|
||||
action="action_view_survey_name" parent="menu_surveys_analyze"
|
||||
groups="base.group_tool_manager"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
Reference in New Issue
Block a user