'Runs the server action. For each server action, the condition is
checked. Note that a void (``False``) condition is considered as always
valid. If it is verified, the run_action_<STATE> method is called. This
allows easy overriding of the server actions.
:param dict context: context should contain following keys
- active_id: id of the current object (single mode)
- active_model: current model that should equal the action\'s model
The following keys are optional:
- active_ids: ids of the current records (mass mode). If active_ids
and active_id are present, active_ids is given precedence.
:return: an action_id to be executed, or False is finished correctly without
return action'

@api.multi
def run(self):

    res = False
    for action in self:
        eval_context = self._get_eval_context(action)
        condition = action.condition
        if (condition is False):
            condition = True
        if hasattr(self, ('run_action_%s_multi' % action.state)):
            expr = safe_eval(str(condition), eval_context)
            if (not expr):
                continue
            run_self = self.with_context(eval_context['context'])
            func = getattr(run_self, ('run_action_%s_multi' % action.state))
            res = func(action, eval_context=eval_context)
        elif hasattr(self, ('run_action_%s' % action.state)):
            active_id = self._context.get('active_id')
            active_ids = self._context.get('active_ids', ([active_id] if active_id else []))
            for active_id in active_ids:
                run_self = self.with_context(active_ids=[active_id], active_id=active_id)
                eval_context['context'] = run_self._context
                expr = safe_eval(str(condition), eval_context)
                if (not expr):
                    continue
                func = getattr(run_self, ('run_action_%s' % action.state))
                res = func(action, eval_context=eval_context)
    return res
