[IMP] survey: needaction
bzr revid: chm@openerp.com-20130220162558-eh4a0uym488ifbel
This commit is contained in:
@@ -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'),
|
||||
|
||||
@@ -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="['&', ('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'}"/>
|
||||
|
||||
Reference in New Issue
Block a user