'Override to add the request object in eval_context.'

@api.model
def _get_eval_context(self, action):

    eval_context = super(ServerAction, self)._get_eval_context(action)
    if (action.state == 'code'):
        eval_context['request'] = request
    return eval_context
