I found the answer and I used it and it is working very well now !!
if you use "ir.actions.server" model for your action, you cant display record count on your menuitem in view. for this issue, you can override "search_read" function and implement your ir.actions.server function that you had implemented. and change the "ir.actions.server" model to "ir.actions.act_window" model. now you can use _needaction_domain_get or _needaction_count functions for your purpose.
def search_read(self, cr, uid, domain=None, fields=None, offset=0, limit=None, order=None, context=None):
record_ids = self.search(cr, uid, domain or [], offset=offset, limit=limit, order=order, context=context)
if not record_ids:
return []
if fields and fields == ['id']:
return [{'id': id} for id in record_ids]
read_ctx = dict(context or {})
read_ctx.pop('active_test', None)
result = self.read(cr, uid, record_ids, fields, context=read_ctx)
if len(result) <= 1:
return result
index = dict((r['id'], r) for r in result)
return [index[x] for x in record_ids if x in index]