[IMP] 'needaction_pending' field: not necessary to read a table as the information is already available in object.

bzr revid: tde@openerp.com-20120418094554-n5p2wf599tbmhizi
This commit is contained in:
Thibault Delavallée 2012-04-18 11:45:54 +02:00
parent 22adea444c
commit 9012e82d77
1 changed files with 2 additions and 2 deletions

View File

@ -117,9 +117,9 @@ class ir_needaction_mixin(osv.osv):
def get_needaction_pending(self, cr, uid, ids, name, arg, context=None):
res = {}
rel_obj = self.pool.get('ir.needaction_users_rel')
needaction_user_ids = self.get_needaction_user_ids(cr, uid, ids, context=context)
for id in ids:
res[id] = rel_obj.search(cr, uid, [('res_model', '=', self._name), ('res_id', '=', id), ('user_id', '=', uid)], limit=1, count=True, context=context) > 0
res[id] = uid in needaction_user_ids[id]
return res
_columns = {