'Need action on a mail.message = notified on my channel'

@api.multi
def _get_needaction(self):

    my_messages = self.env['mail.notification'].sudo().search([('mail_message_id', 'in', self.ids), ('res_partner_id', '=', self.env.user.partner_id.id), ('is_read', '=', False)]).mapped('mail_message_id')
    for message in self:
        message.needaction = (message in my_messages)
