[ADD] make needaction_pending field searchable

bzr revid: xmo@openerp.com-20120608112211-08huawbsjd31mjy6
This commit is contained in:
Xavier Morel 2012-06-08 13:22:11 +02:00
parent 4dcc28c2c9
commit 019bdb14b9
1 changed files with 12 additions and 5 deletions

View File

@ -129,13 +129,20 @@ class ir_needaction_mixin(osv.osv):
for id in ids:
res[id] = uid in needaction_user_ids[id]
return res
def search_needaction_pending(self, cr, uid, self_again, field_name, criterion, context=None):
ids = self.needaction_get_record_ids(
cr, uid, uid, limit=False, context=context)
return [('id', 'in', ids)]
_columns = {
'needaction_pending': fields.function(get_needaction_pending, type='boolean',
string='Need action pending',
help='If True, this field states that users have to perform an action. \
This field comes from the needaction mechanism. Please refer \
to the ir.needaction_mixin class.'),
'needaction_pending': fields.function(
get_needaction_pending, type='boolean',
fnct_search=search_needaction_pending,
string='Need action pending',
help="If True, this field states that users have to perform an action." \
" This field comes from the needaction mechanism." \
" Please refer to the ir.needaction_mixin class."),
}
#------------------------------------------------------