title: OpenERP wizard syntax
body: <p>i'm trying to create a new wizard and i hadn't understood a lot about how to do that :(
  In some guides i find this code:</p>
  
  <pre><code>&lt;wizard
      id="test_wizard"
      keyword="client_action_multi"
      model="product.product"
      name="product.product.product_id"
      string="Test wizard" /&gt;
  </code></pre>
  
  <p>and in the technical memento i found this:</p>
  
  <pre><code>&lt;record id="action_idea_cleanup_wizard" model="ir.actions.act_window"&gt; 
   &lt;field name="name"&gt;Cleanup&lt;/field&gt; 
   &lt;field name="type"&gt;ir.actions.act_window&lt;/field&gt; 
   &lt;field name="res_model"&gt;idea.cleanup.wizard&lt;/field&gt; 
   &lt;field name="view_type"&gt;form&lt;/field&gt; 
   &lt;field name="view_mode"&gt;form&lt;/field&gt; 
   &lt;field name="target"&gt;new&lt;/field&gt; 
  &lt;/record&gt;
  </code></pre>
  
  <p>which syntax should i use? </p>
  
  <hr>
  
  <p>EDIT: I've tried to do the wizard, here's the code:</p>
  
  <p>python file:</p>
  
  <pre><code>from openerp.osv import osv
  from openerp.osv import fields
  
  
  class create_ean(osv.osv_memory):
      _name='generate.ean'
  
      _columns = {
          'product_def_code' : fields.text('Product Default Code'),
          'product_gen_code' : fields.text('Product Generated EAN13', readonly = True),
      }
  
      #defaults calls a function that will browse your main object and fill the field with the existing information
      _defaults = {
          'product_def_code': lambda self, cr, uid, context: self._get_product_id(cr, uid, context),
          'product_gen_code': lambda self, cr, uid, context: self.generate_ean(),
      }
  
      def save_code(self, cr, uid, ids, context=None):
          if 'active_id' in context:
              info = self.browse(cr,uid,ids)
              self.pool.get('ean13').write(cr,uid,context['active_id'],{'ean13': info[0].product_gen_code})
  
          return {
              'type': 'ir.actions.act_window_close',
              }
      def generate_ean(self):
          return "ouhdeguosAB13"
  
      def _get_product_id(self, cr, uid, context=None):
          if 'active_id' in context:
              return self.pool.get('product.product').browse(cr, uid, context['active_id'], context).product_id
  
      create_ean()
  </code></pre>
  
  <p>XML File:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;openerp&gt;
  &lt;data&gt;
      &lt;!-- create a view with a unique id --&gt;
      &lt;record id="view_generate_ean13_code_wizard" model="ir.ui.view"&gt;
          &lt;field name="name"&gt;generate_ean13_code.form&lt;/field&gt;
          &lt;field name="model"&gt;product.product&lt;/field&gt;
          &lt;field name="type"&gt;form&lt;/field&gt;
          &lt;field name="arch" type="xml"&gt;
          &lt;!-- create a normal form view, with the fields you've created on your python file --&gt;
              &lt;form string="Insert reformulation info" version="7.0"&gt;
                  &lt;group &gt;
                      &lt;separator string="EAN13 Code Generator" colspan="2"/&gt;
                      &lt;field name="product_def_code" string="Product Default Code"/&gt;
                      &lt;field name="product_gen_code" string="Product EAN13 Generated Code"/&gt;
                      &lt;newline/&gt;
                  &lt;/group&gt;
                  &lt;div style="text-align:right"&gt;
                      &lt;button  icon="gtk-cancel" special="cancel" string="Cancel"/&gt;
                      &lt;button  icon="gtk-ok" name="save_code" string="Save the code" type="object" /&gt;
                  &lt;/div&gt;
  
             &lt;/form&gt;
          &lt;/field&gt;
      &lt;/record&gt;
      &lt;!-- your action window refers to the view_id you've just created --&gt;
      &lt;record id="action_generate_ean" model="ir.actions.act_window"&gt;
          &lt;field name="name"&gt;Generate EAN13&lt;/field&gt;
          &lt;field name="type"&gt;ir.actions.act_window&lt;/field&gt;
          &lt;field name="res_model"&gt;generate.ean&lt;/field&gt;
          &lt;field name="view_type"&gt;form&lt;/field&gt;
          &lt;field name="view_mode"&gt;form&lt;/field&gt;
          &lt;field name="view_id" ref="view_generate_ean13_code_wizard"/&gt;
          &lt;field name="target"&gt;new&lt;/field&gt; 
      &lt;/record&gt;
  
      &lt;act_window id="action_generate_ean"
              name="Generate EAN13"
              res_model="generate.ean"
              view_mode="form" 
              target="new"
      /&gt;
  &lt;/data&gt;
  &lt;/openerp&gt;
  </code></pre>
  
  <p>I'll explain what i need to do, substantially i need to take the product_id of the product and with that i generate the ean13, i made a test method for the generation of the code but i have not understand how to save the generated code in the ean13 field and how use my method to generate that code by passing him the product_id</p>