[IMP] survey: needaction

bzr revid: chm@openerp.com-20130220162558-eh4a0uym488ifbel
This commit is contained in:
Christophe Matthieu
2013-02-20 17:25:58 +01:00
parent 9532f4ef93
commit e06979f2de
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -39,6 +39,10 @@ class survey(osv.osv):
_name = 'survey'
_description = 'Survey'
_rec_name = 'title'
_inherit = ['ir.needaction_mixin']
def _needaction_domain_get(self, cr, uid, context=None):
return ['&', ('response_ids.state', 'in', ['new', 'skip']), ('response_ids.partner_id.user_id', '=', uid)]
def default_get(self, cr, uid, fields, context=None):
data = super(survey, self).default_get(cr, uid, fields, context)
@@ -603,6 +607,7 @@ survey_answer()
class survey_response(osv.osv):
_name = "survey.response"
_rec_name = 'date_create'
_columns = {
'date_deadline': fields.date("Deadline date", help="Date by which the person can respond to the survey"),
'survey_id': fields.many2one('survey', 'Survey', required=1, readonly=1, ondelete='cascade'),
+2 -1
View File
@@ -265,7 +265,8 @@
<filter string="Closed" domain="[('state','=','close')]"/>
<filter string="Canceled" domain="[('state','=','cancel')]"/>
<separator/>
<filter string="My Survey(s)" icon="terp-personal" domain="[('responsible_id','=',uid)]" help="My Survey(s)"/>
<filter string="My Surveys" domain="[('responsible_id','=',uid)]" help="The surveys I am responsible of"/>
<filter string="Survey to fill in" name="unread_message" domain="['&amp;', ('response_ids.state', 'in', ['new', 'skip']), ('response_ids.partner_id.user_id', '=', uid)]"/>
<field name="responsible_id"/>
<group expand="0" string="Group By...">
<filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'responsible_id'}"/>