[MOD] survey : Usability improvements

bzr revid: vir@tinyerp.com-20100827084103-re6uh4n95y8xg98e
This commit is contained in:
Amp (Open ERP) 2010-08-27 14:11:03 +05:30 committed by Vir (Open ERP)
parent b7e4107a4e
commit 4db08030be
6 changed files with 36 additions and 23 deletions

View File

@ -55,7 +55,8 @@ class survey(osv.osv):
'page_ids': fields.one2many('survey.page', 'survey_id', 'Page'),
'date_open': fields.datetime('Survey Open Date', readonly=1),
'date_close': fields.datetime('Survey Close Date', readonly=1),
'max_response_limit': fields.integer('Maximum Answer Limit'),
'max_response_limit': fields.integer('Maximum Answer Limit',
help="Set to one if survey is answerable only once"),
'response_user': fields.integer('Maximum Answer per User',
help="Set to one if you require only one Answer per user"),
'state': fields.selection([('draft', 'Draft'), ('open', 'Open'), ('close', 'Closed'), ('cancel', 'Cancelled')], 'Status', readonly=True),
@ -691,7 +692,7 @@ class survey_request(osv.osv):
}
_defaults = {
'state': lambda * a: 'draft',
'date_deadline': lambda * a : (now() + RelativeDateTime(months=+1)).strftime("%Y-%m-%d %H:%M:%S")
# 'date_deadline': lambda * a : (now() + RelativeDateTime(months=+1)).strftime("%Y-%m-%d %H:%M:%S")
}
def survey_req_waiting_answer(self, cr, uid, ids, arg):
self.write(cr, uid, ids, { 'state' : 'waiting_answer'})

View File

@ -6,20 +6,20 @@
id="report_survey_form"
model="survey"
name="survey.form"
string="Surveys"/>
string="Survey"/>
<report auto="True"
id="survey_analysis"
model="survey"
name="survey.analysis"
rml=""
string="Surveys Statistics"/>
string="Survey Statistics"/>
<report auto="True"
id="survey_browse_response"
model="survey"
name="survey.browse.response"
rml=""
string="Surveys Answers"/>
string="Survey Answers"/>
</data>
</openerp>

View File

@ -196,7 +196,7 @@
</page>
<page string="Other">
<group colspan="6" col='4'>
<field name="max_response_limit" select="1"
<field name="max_response_limit"
attrs="{'readonly':[('state','in',('open','close'))]}"/>
<field name="response_user"
attrs="{'readonly':[('state','in',('open','close'))]}"/>
@ -260,8 +260,7 @@
<field name="arch" type="xml">
<search string="Search Survey">
<group col='10' colspan='4'>
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]"/>
<filter string="Open" icon="terp-check" domain="[('state','=','open')]"/>
<filter icon="terp-document-new" string="Current" domain="[('state','in', ('draft', 'open'))]"/>
<separator orientation="vertical"/>
<field name="title" select="1"/>
<field name="type" select="1" widget="selection"/>
@ -271,8 +270,9 @@
</group>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="20">
<filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type'}"/>
<filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'responsible_id'}"/>
<separator orientation="vertical"/>
<filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type'}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
</group>
</search>
@ -679,6 +679,10 @@
<field name="page_id"/>
<field name="survey" widget="selection"/>
<field name="type"/>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="20">
<filter string="Page" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'page_id'}"/>
</group>
</search>
</field>
</record>
@ -1087,15 +1091,23 @@
<field name="arch" type="xml">
<search string="Search Survey">
<group col='10' colspan='4'>
<filter icon="terp-emblem-important" string="Unanswered" domain="[('state','=','waiting_answer')]"/>
<filter icon="terp-gtk-media-pause" string="Late" domain="[('date_deadline','&lt;',current_date)]"/>
<filter icon="terp-gtk-media-pause" string="Waiting Answer" domain="[('state','=','waiting_answer')]"/>
<filter icon="terp-emblem-important" string="Late" domain="[('date_deadline','&lt;',current_date)]"/>
<separator orientation="vertical"/>
<field name="survey_id" widget="selection" select="1"/>
<field name="email" select="1"/>
<field name="user_id" select="1" widget="selection" default="1">
<field name="user_id" select="1" default="1">
<filter string="MY" icon="terp-personal" domain="[('user_id','=',uid)]"/>
</field>
</group>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="20">
<filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Survey" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'survey_id'}"/>
<separator orientation="vertical"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
</group>
</search>
</field>
</record>
@ -1151,26 +1163,26 @@
<act_window domain="[('survey_id', '=', active_id)]"
id="act_survey_pages"
name="Survey Pages"
name="Pages"
res_model="survey.page"
src_model="survey"/>
<act_window domain="[('survey', '=', active_id)]"
id="act_survey_question"
name="All Questions"
name="Questions"
res_model="survey.question"
src_model="survey"/>
<act_window domain="[('page_id', '=', active_id)]"
id="act_survey_page_question"
name="Survey Questions"
name="Questions"
res_model="survey.question"
src_model="survey.page"/>
<act_window domain="[('question_id', '=', active_id)]"
id="act_survey_answer"
name="Survey Answers"
name="Answers"
res_model="survey.answer"
src_model="survey.question"/>

View File

@ -46,7 +46,7 @@ class survey_browse_answer(osv.osv_memory):
_columns = {
'survey_id': fields.selection(_get_survey, "Survey", required="1"),
'response_id': fields.many2one("survey.response", "Survey Answer", help="If you want to print all answer of selected survey then don't select survey answer and if you select survey answer then print only selected survey answer."),
'response_id': fields.many2one("survey.response", "Survey Answers", help="If you want to print all answers of selected survey then don't select survey answer and if you select survey answer then print only selected survey answer."),
}
def action_next(self, cr, uid, ids, context=None):

View File

@ -41,8 +41,8 @@ class survey_send_invitation(osv.osv_memory):
'survey_id', "Answer", required=1),
'send_mail': fields.boolean('Send mail for new user'),
'send_mail_existing': fields.boolean('Send reminder for existing user'),
'mail_subject': fields.char('Subject', size=256, required=1),
'mail_subject_existing': fields.char('Subject', size=256, required=1),
'mail_subject': fields.char('Subject', size=256),
'mail_subject_existing': fields.char('Subject', size=256),
'mail_from': fields.char('From', size=256, required=1),
'mail': fields.text('Body')
}
@ -212,4 +212,4 @@ class survey_send_invitation_log(osv.osv_memory):
survey_send_invitation_log()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -41,7 +41,7 @@
</record>
<act_window id="action_act_view_survey_send_invitation"
key2="client_action_multi" name="Send Invitation"
key2="client_action_multi" name="Send Invitations"
res_model="survey.send.invitation" src_model="survey"
view_mode="form" target="new" view_type="form" />
@ -74,4 +74,4 @@
<field name="target">new</field>
</record>
</data>
</openerp>
</openerp>