title: Activate a workflow transition from wizard in OpenERP 7.0
body: <p>I've set up a wizard in OpenERP 7.0 that is updating fields correctly and all is working fine. But I would like to send a signal to the workflow from that wizard after user submits information to check if there is any transition to be taken.</p>
  
  <p>My wizard code is the following:</p>
  
  <pre><code>from openerp.osv import osv
  from openerp.osv import fields
  from openerp.tools.translate import _
  
  class ref_generic_request(osv.osv_memory):
      _name='ref.generic.request'
  
      _columns = {
          'reformulation_info': fields.text('Reformulation instructions', help='Instructions for the requestor justification the reformulation needs'),
              }
  
  
      def save_info(self, cr, uid, ids, context=None):
          if 'active_id' in context:
              info=self.browse(cr,uid,ids)[0].reformulation_info
              self.pool.get('generic.request').write(cr,uid,context['active_id'],{'reformulation_info' : info, 'needs_reformulation': 1})
          return {
                  'type': 'ir.actions.act_window_close',
           }
  ref_generic_request()
  </code></pre>
  
  <p>And in this particular case I would like to signal this function in my <code>generic.request</code> object:</p>
  
  <pre><code>def req_reformulate_request(self, cr, uid, ids, context=None):
      req = self.browse(cr, uid, ids, context=context)
      goto = req[0].state
      if goto:
          self.write(cr, uid, ids, {'goto': goto, 'state': 'req_reformulation', 'needs_reformulation': True} )
      else:
          self.write(cr, uid, ids, {'state': 'req_reformulation', 'needs_reformulation': True})
      self.insert_trace(cr, uid, ids, context)
      return True
  </code></pre>
  
  <p>How should I do that?</p>
  
  <p>Do I have to call the function inside the <code>def save_info()</code>? (I've tried this call <code>self.pool.get('generic.request').req_reformulate_request(cr, uid, context['active_id'], context)</code> but it throws so many errors, that I quickly gave up this approach)</p>
  
  <p>Do I have to return something like <code>'signal': 'generic.request.req_reformulate_request'</code> ?
  Since I didn't find any information on this, I'm completely lost here, so any help would be very appreciated!</p>
  
  <p>Thanks!</p>
  
  <p>Here is the workflow definition:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;openerp&gt;
      &lt;data&gt;
          &lt;record model="workflow" id="wkf_request"&gt;
              &lt;field name="name"&gt;request.wkf&lt;/field&gt;
              &lt;field name="osv"&gt;generic.request&lt;/field&gt;
              &lt;field name="on_create"&gt;True&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;!-- actividades --&gt;
          &lt;record model="workflow.activity" id="act_draft"&gt;
              &lt;field name="wkf_id" ref="wkf_request" /&gt;
              &lt;field name="flow_start"&gt;True&lt;/field&gt;
              &lt;field name="name"&gt;request_draft&lt;/field&gt;
              &lt;field name="kind"&gt;function&lt;/field&gt;
              &lt;field name="action"&gt;request_draft()&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.activity" id="act_submit"&gt;
              &lt;field name="wkf_id" ref="wkf_request" /&gt;
              &lt;field name="name"&gt;request_submitted&lt;/field&gt;
              &lt;field name="kind"&gt;function&lt;/field&gt;
              &lt;field name="action"&gt;submit_request()&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.activity" id="act_confirm"&gt;
              &lt;field name="wkf_id" ref="wkf_request" /&gt;
              &lt;field name="name"&gt;request_confirmed&lt;/field&gt;
              &lt;field name="kind"&gt;function&lt;/field&gt;
              &lt;field name="action"&gt;confirm_request()&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.activity" id="act_closed_nconf"&gt;
              &lt;field name="wkf_id" ref="wkf_request" /&gt;
              &lt;field name="name"&gt;request_closed_nconf&lt;/field&gt;
              &lt;field name="action_id" ref="ir_actions_server_send_email_when_closed_nconf"/&gt;
              &lt;field name="kind"&gt;function&lt;/field&gt;
              &lt;field name="action"&gt;close_nconf_request()&lt;/field&gt;
              &lt;field name="flow_stop"&gt;True&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.activity" id="act_req_reformulate"&gt;
              &lt;field name="wkf_id" ref="wkf_request" /&gt;
              &lt;field name="name"&gt;request_reformulation&lt;/field&gt;
              &lt;field name="kind"&gt;function&lt;/field&gt;
              &lt;field name="action"&gt;req_reformulate_request()&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.activity" id="act_treatment"&gt;
              &lt;field name="wkf_id" ref="wkf_request" /&gt;
              &lt;field name="name"&gt;request_treatment&lt;/field&gt;
              &lt;field name="kind"&gt;function&lt;/field&gt;
              &lt;field name="action"&gt;treat_request()&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.activity" id="act_taken"&gt;
              &lt;field name="wkf_id" ref="wkf_request" /&gt;
              &lt;field name="name"&gt;request_take&lt;/field&gt;
              &lt;field name="kind"&gt;function&lt;/field&gt;
              &lt;field name="action"&gt;take_request()&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.activity" id="act_given"&gt;
              &lt;field name="wkf_id" ref="wkf_request" /&gt;
              &lt;field name="name"&gt;request_give&lt;/field&gt;
              &lt;field name="kind"&gt;function&lt;/field&gt;
              &lt;field name="action"&gt;give_request()&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.activity" id="act_closed"&gt;
              &lt;field name="wkf_id" ref="wkf_request" /&gt;
              &lt;field name="name"&gt;request_closed&lt;/field&gt;
              &lt;field name="kind"&gt;function&lt;/field&gt;
              &lt;field name="action"&gt;close_request()&lt;/field&gt;
              &lt;field name="flow_stop"&gt;True&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.activity" id="act_awaiting_auth"&gt;
              &lt;field name="wkf_id" ref="wkf_request" /&gt;
              &lt;field name="name"&gt;request_awaiting_authorization&lt;/field&gt;
              &lt;field name="kind"&gt;function&lt;/field&gt;
              &lt;field name="action"&gt;wait_auth_request()&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.activity" id="act_closed_ref"&gt;
              &lt;field name="wkf_id" ref="wkf_request" /&gt;
              &lt;field name="name"&gt;request_closed_ref&lt;/field&gt;
              &lt;field name="kind"&gt;function&lt;/field&gt;
              &lt;field name="action"&gt;close_ref_request()&lt;/field&gt;
              &lt;field name="flow_stop"&gt;True&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.activity" id="act_awaiting_appr"&gt;
              &lt;field name="wkf_id" ref="wkf_request" /&gt;
              &lt;field name="name"&gt;request_awainting_approval&lt;/field&gt;
              &lt;field name="kind"&gt;function&lt;/field&gt;
              &lt;field name="action"&gt;wait_appr_request()&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.activity" id="act_closed_disappr"&gt;
              &lt;field name="wkf_id" ref="wkf_request" /&gt;
              &lt;field name="name"&gt;request_closed_disappr&lt;/field&gt;
              &lt;field name="kind"&gt;function&lt;/field&gt;
              &lt;field name="action"&gt;close_disappr_request()&lt;/field&gt;
              &lt;field name="flow_stop"&gt;True&lt;/field&gt;
          &lt;/record&gt;
          &lt;!-- transições --&gt;
          &lt;record model="workflow.transition" id="request_t1"&gt;
              &lt;field name="act_from" ref="act_draft" /&gt;
              &lt;field name="act_to" ref="act_submit" /&gt;
              &lt;field name="signal"&gt;submit_request&lt;/field&gt;
          &lt;/record&gt;
          &lt;!--
          &lt;record model="workflow.transition" id="request_t101"&gt;
              &lt;field name="act_from" ref="act_draft" /&gt;
              &lt;field name="act_to" ref="act_confirm" /&gt;
              &lt;field name="signal"&gt;submit_request&lt;/field&gt;
              &lt;field name="condition"&gt;check_responsible()&lt;/field&gt;
          &lt;/record&gt;
          --&gt;
  
          &lt;record model="workflow.transition" id="request_t102"&gt;
              &lt;field name="act_from" ref="act_submit" /&gt;
              &lt;field name="act_to" ref="act_confirm" /&gt;
              &lt;field name="condition"&gt;check_responsible()&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.transition" id="request_t2"&gt;
              &lt;field name="act_from" ref="act_submit" /&gt;
              &lt;field name="act_to" ref="act_req_reformulate" /&gt;
              &lt;field name="signal"&gt;req_reformulate_request&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.transition" id="request_t3"&gt;
              &lt;field name="act_from" ref="act_req_reformulate" /&gt;
              &lt;field name="act_to" ref="act_submit" /&gt;
              &lt;field name="signal"&gt;submit_request&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.transition" id="request_t1001"&gt;
              &lt;field name="act_from" ref="act_submit" /&gt;
              &lt;field name="act_to" ref="act_confirm" /&gt;
              &lt;field name="condition"&gt;ref_goto_confirmed()&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.transition" id="request_t1002"&gt;
              &lt;field name="act_from" ref="act_submit" /&gt;
              &lt;field name="act_to" ref="act_treatment" /&gt;
              &lt;field name="condition"&gt;ref_goto_treatment()&lt;/field&gt;
          &lt;/record&gt;
  
  
          &lt;record model="workflow.transition" id="request_t4"&gt;
              &lt;field name="act_from" ref="act_submit" /&gt;
              &lt;field name="act_to" ref="act_confirm" /&gt;
              &lt;field name="signal"&gt;confirm_request&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.transition" id="request_t5"&gt;
              &lt;field name="act_from" ref="act_submit" /&gt;
              &lt;field name="act_to" ref="act_closed_nconf" /&gt;
              &lt;field name="signal"&gt;close_nconf_request&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.transition" id="request_t6"&gt;
              &lt;field name="act_from" ref="act_confirm" /&gt;
              &lt;field name="act_to" ref="act_treatment" /&gt;
              &lt;field name="signal"&gt;treat_request&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.transition" id="request_t7"&gt;
              &lt;field name="act_from" ref="act_treatment" /&gt;
              &lt;field name="act_to" ref="act_closed" /&gt;
              &lt;field name="signal"&gt;close_request&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.transition" id="request_t7011"&gt;
              &lt;field name="act_from" ref="act_treatment" /&gt;
              &lt;field name="act_to" ref="act_taken" /&gt;
              &lt;field name="signal"&gt;take_request&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.transition" id="request_t7012"&gt;
              &lt;field name="act_from" ref="act_taken" /&gt;
              &lt;field name="act_to" ref="act_treatment" /&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.transition" id="request_t7021"&gt;
              &lt;field name="act_from" ref="act_treatment" /&gt;
              &lt;field name="act_to" ref="act_given" /&gt;
              &lt;field name="signal"&gt;give_request&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.transition" id="request_t7022"&gt;
              &lt;field name="act_from" ref="act_given" /&gt;
              &lt;field name="act_to" ref="act_treatment" /&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.transition" id="request_t8"&gt;
              &lt;field name="act_from" ref="act_treatment" /&gt;
              &lt;field name="act_to" ref="act_awaiting_auth" /&gt;
              &lt;field name="signal"&gt;wait_auth_request&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.transition" id="request_t9"&gt;
              &lt;field name="act_from" ref="act_awaiting_auth" /&gt;
              &lt;field name="act_to" ref="act_closed_ref" /&gt;
              &lt;field name="signal"&gt;close_ref_request&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.transition" id="request_t10"&gt;
              &lt;field name="act_from" ref="act_awaiting_auth" /&gt;
              &lt;field name="act_to" ref="act_treatment" /&gt;
              &lt;field name="signal"&gt;auth_send_processing&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.transition" id="request_t11"&gt;
              &lt;field name="act_from" ref="act_treatment" /&gt;
              &lt;field name="act_to" ref="act_req_reformulate" /&gt;
              &lt;field name="signal"&gt;req_reformulate_request&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.transition" id="request_t12"&gt;
              &lt;field name="act_from" ref="act_treatment" /&gt;
              &lt;field name="act_to" ref="act_awaiting_appr" /&gt;
              &lt;field name="signal"&gt;wait_appr_request&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.transition" id="request_t13"&gt;
              &lt;field name="act_from" ref="act_awaiting_appr" /&gt;
              &lt;field name="act_to" ref="act_closed_disappr" /&gt;
              &lt;field name="signal"&gt;close_disappr_request&lt;/field&gt;
          &lt;/record&gt;
  
          &lt;record model="workflow.transition" id="request_t14"&gt;
              &lt;field name="act_from" ref="act_awaiting_appr" /&gt;
              &lt;field name="act_to" ref="act_treatment" /&gt;
              &lt;field name="signal"&gt;appr_send_processing&lt;/field&gt;
          &lt;/record&gt;
  
      &lt;/data&gt;
  &lt;/openerp&gt;
  </code></pre>
  
  <p>The transition I want to trigger in this particular case is the one with id="request_t2"</p>
  
  <pre><code>&lt;record model="workflow.transition" id="request_t2"&gt;
      &lt;field name="act_from" ref="act_submit" /&gt;
      &lt;field name="act_to" ref="act_req_reformulate" /&gt;
      &lt;field name="signal"&gt;req_reformulate_request&lt;/field&gt;
  &lt;/record&gt;
  </code></pre>
  
  <p>And here is a screenshot of the workflow, the highlighted transition is the one I want to trigger.
  <img src="https://i.stack.imgur.com/Az33X.png" alt="enter image description here"></p>