[FIX] project: filter "Followed by Me"
The filter "Followed by Me" depends on a calculated field is not stored. Therefore, we need to redefine the search method. Fixes #8920
This commit is contained in:
@@ -326,6 +326,13 @@ class project(osv.osv):
|
||||
tasks.write({'active': vals['active']})
|
||||
return res
|
||||
|
||||
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
|
||||
context = dict(context or {})
|
||||
if context.get('message_is_follower', False):
|
||||
res = super(project, self).search(cr, uid, args, offset=offset, limit=limit, order=order, context=context, count=count)
|
||||
return [proj.id for proj in self.browse(cr, uid, res, context=context) if proj.message_is_follower]
|
||||
return super(project, self).search(cr, uid, args, offset=offset, limit=limit, order=order, context=context, count=count)
|
||||
|
||||
|
||||
class task(osv.osv):
|
||||
_name = "project.task"
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
<filter string="Pending" name="Pending" domain="[('state', '=','pending')]"/>
|
||||
<separator/>
|
||||
<filter string="Manager" domain="[('user_id','=',uid)]"/>
|
||||
<filter string="Followed by Me" domain="[('message_is_follower','=',True)]"/>
|
||||
<filter string="Followed by Me" context="{'message_is_follower': True}"/>
|
||||
<separator/>
|
||||
<filter string="Important Messages" name="message_needaction" domain="[('message_needaction','=',True)]"/>
|
||||
<filter string="Archived" name="inactive" domain="[('active','=',False)]"/>
|
||||
|
||||
Reference in New Issue
Block a user