Warning: include_once(/home/favoledo/robertozanardo.com/wp-content/sunrise.php): Failed to open stream: No such file or directory in /home/favoledo/robertozanardo.com/wp-includes/ms-settings.php on line 52

Warning: include_once(): Failed opening '/home/favoledo/robertozanardo.com/wp-content/sunrise.php' for inclusion (include_path='.:/opt/alt/php83/usr/share/pear:/opt/alt/php83/usr/share/php:/usr/share/pear:/usr/share/php') in /home/favoledo/robertozanardo.com/wp-includes/ms-settings.php on line 52
Simpler way to call wizard or form from button in Odoo (No action in xml) - Odoo e Soluzioni Open Source

Simpler way to call wizard or form from button in Odoo (No action in xml)

Simpler way to call wizard or form from button in Odoo (No action in xml)

Define the wizard in py:

class ProductWizard(models.TransientModel):
   _name = 'product.wizard'

   range_start = fields.Integer('range_start')
   range_end = fields.Integer('range_end')
   range_dist = fields.Char('range_dist')

   @api.multi
   def create_set(self):
      context = dict(self._context or {})
      raise UserError(_("TEST REPORT"))

and in xml:

<record id="view_test_report_wizard" model="ir.ui.view">
   <field name="name">Product Wizard</field>
   <field name="model">product.wizard</field>
   <field name="arch" type="xml">
   <form string="Choose The Details">
   <group>
      <group>
      <field name="range_start" string="Range start from:"/>
      <field name="range_end" string="Range end:"/>
      <field name="range_dist" string="Size distribution:" placeholder="Es.: 1-1-2-2-2-2"/>
      </group>
   </group>
   <footer>
      <button name="create_set" string="Print" type="object" class="oe_highlight" />
      or
      <button string="Cancel" class="oe_link" special="cancel"/>
   </footer>
</form>
</field>
</record>

Define call in .py

@api.multi
def open_wizard(self):
   return {
   'view_type': 'form',
   'view_mode': 'form',
   'res_model': 'product.wizard',
   'target': 'new',
   'type': 'ir.actions.act_window',
   'context': {'current_id': self.id}
   }

Call it from button this way:

<button name="open_wizard" string="My wiz" type="object" class="oe_highlight"/>

 

 

Lascia un commento

kolaybet giriş
betgaranti
bettilt
hellocasino
betgaranti
Kolaybet
bettilt
Kolaybet Giriş
Kolaybet
Kolaybet Giriş
Kolaybet
Kolaybet Giriş
Kolaybet
matbet güncel giriş
matbet güncel giriş
matbet güncel giriş
matbet güncel giriş
Hititbet Giriş
betgaranti
Hellocasino
Hello Casino
Hititbet
hititbet
vdcasino
hititbet
bettilt
hititbet giriş
hititbet giriş
vdcasino
kolaybet
kolaybet
betpark
Kolaybet Giriş
betpark
betgaranti
kuponbet giriş
betpark
betgaranti
sahabet
onwin
sahabet
sahabet
sahabet
sahabet
onwin
onwin
onwin
onwin
holiganbet
grandpashabet
onwin
onwin
betpark
betpark
bettilt
mariobet giriş
onwin
onwin
mariobet
betorder
betpark
betorder
safirbet
mariobet
betgaranti
grandpashabet
betgaranti
betpark
betpark
betgaranti
betpark