'Overrides mail_thread message_post so that we can set the date of last action field when
a new message is posted on the issue.'

@api.multi
@api.returns('mail.message', (lambda value: value.id))
def message_post(self, subtype=None, **kwargs):

    self.ensure_one()
    mail_message = super(ProjectIssue, self).message_post(subtype=subtype, **kwargs)
    if subtype:
        self.sudo().write({'date_action_last': fields.Datetime.now()})
    return mail_message
