title: Value error when trying to call a Wizard in Odoo 12
body: <p>i am using odoo 12, and when trying to call a wizard in an action button it does not works</p>
  <p>What is weird is if i use the wizard as a button (just for testing) it works.</p>
  <p>Here is my code</p>
  <p>This is the action dropdown button</p>
  <pre><code>    &lt;!--action dropdown--&gt;
      &lt;record id=&quot;action_enviar_a_evaluacion&quot; model=&quot;ir.actions.server&quot;&gt;
          &lt;field name=&quot;name&quot;&gt;Enviar a evaluacion&lt;/field&gt;
          &lt;field name=&quot;model_id&quot; ref=&quot;model_pdi_riesgo&quot;/&gt;
          &lt;field name=&quot;state&quot;&gt;code&lt;/field&gt;
          &lt;field name=&quot;code&quot;&gt;
              pdi_riesgo_wizard_evaluacion.enviar_a_evaluar()
          &lt;/field&gt;
  
          &lt;field name=&quot;binding_model_id&quot; ref=&quot;model_pdi_riesgo&quot;/&gt;
      &lt;/record&gt;
  </code></pre>
  <p>And this is the method i am trying to call</p>
  <pre><code>@api.multi
      def enviar_a_evaluar(self,ids):
          r_fase_en_evaluacion=self.env['pdi.riesgo.fase'].search([('sequence','=',2)])
          #self.riesgo.fase_evaluacion=r_fase_en_evaluacion.id
          registros = self.browse(ids)
  
          for riesgo in registros:
              riesgo.fase_evaluacion=r_fase_en_evaluacion.id
              record=self.env['pdi.riesgo.evaluacion'].sudo().create({
                  'riesgo':riesgo.id,
                  'fase':r_fase_en_evaluacion.id,
                  'comentario':'Se envia a evaluar',
                  'fecha_limite':self.fecha_limite
              })
  </code></pre>
  <p>and this is the error i am getting</p>
  <pre><code>Error:
  Odoo Server Error
  
  Traceback (most recent call last):
    File &quot;D:\Odoo 12.0\server\odoo\tools\safe_eval.py&quot;, line 350, in safe_eval
      return unsafe_eval(c, globals_dict, locals_dict)
    File &quot;&quot;, line 1, in &lt;module&gt;
  NameError: name 'pdi_riesgo_wizard_evaluacion' is not defined
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;D:\Odoo 12.0\server\odoo\http.py&quot;, line 656, in _handle_exception
      return super(JsonRequest, self)._handle_exception(exception)
    File &quot;D:\Odoo 12.0\server\odoo\http.py&quot;, line 314, in _handle_exception
      raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
    File &quot;D:\Odoo 12.0\server\odoo\tools\pycompat.py&quot;, line 87, in reraise
      raise value
    File &quot;D:\Odoo 12.0\server\odoo\http.py&quot;, line 698, in dispatch
      result = self._call_function(**self.params)
    File &quot;D:\Odoo 12.0\server\odoo\http.py&quot;, line 346, in _call_function
      return checked_call(self.db, *args, **kwargs)
    File &quot;D:\Odoo 12.0\server\odoo\service\model.py&quot;, line 97, in wrapper
      return f(dbname, *args, **kwargs)
    File &quot;D:\Odoo 12.0\server\odoo\http.py&quot;, line 339, in checked_call
      result = self.endpoint(*a, **kw)
    File &quot;D:\Odoo 12.0\server\odoo\http.py&quot;, line 941, in __call__
      return self.method(*args, **kw)
    File &quot;D:\Odoo 12.0\server\odoo\http.py&quot;, line 519, in response_wrap
      response = f(*args, **kw)
    File &quot;d:\odoo 12.0\server\odoo\addons\web\controllers\main.py&quot;, line 1269, in run
      result = request.env['ir.actions.server'].browse([action_id]).run()
    File &quot;d:\odoo 12.0\server\odoo\addons\base\models\ir_actions.py&quot;, line 553, in run
      res = func(action, eval_context=eval_context)
    File &quot;d:\odoo 12.0\server\odoo\addons\base\models\ir_actions.py&quot;, line 444, in run_action_code_multi
      safe_eval(action.sudo().code.strip(), eval_context, mode=&quot;exec&quot;, nocopy=True)  # nocopy allows to return 'action'
    File &quot;D:\Odoo 12.0\server\odoo\tools\safe_eval.py&quot;, line 373, in safe_eval
      pycompat.reraise(ValueError, ValueError('%s: &quot;%s&quot; while evaluating\n%r' % (ustr(type(e)), ustr(e), expr)), exc_info[2])
    File &quot;D:\Odoo 12.0\server\odoo\tools\pycompat.py&quot;, line 86, in reraise
      raise value.with_traceback(tb)
    File &quot;D:\Odoo 12.0\server\odoo\tools\safe_eval.py&quot;, line 350, in safe_eval
      return unsafe_eval(c, globals_dict, locals_dict)
    File &quot;&quot;, line 1, in &lt;module&gt;
  ValueError: &lt;class 'NameError'&gt;: &quot;name 'pdi_riesgo_wizard_evaluacion' is not defined&quot; while evaluating
  'pdi_riesgo_wizard_evaluacion.enviar_a_evaluar()'
  </code></pre>