Preview
Open Original
- 07 Nov, 2025 *
Define the Wizard Model
Create a new model for your wizard in a Python file:
from odoo import models, fields, api
class YourWizard(models.TransientModel):
_name = 'your.module.wizard'
_description = 'Your Custom Wizard'
# Add your wizard fields here
name = fields.Char(string="Name", required=True)
Create the Wizard View
Define the XML view for your wizard in a view file:
<record id="view_your_wizard_form" model="ir.ui.view">
<field name="name">your.module.wizard.form</field>
<field name="model">your.module.wizard</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="name"/>
</group>
</sheet>
<foot...
- 07 Nov, 2025 *
Define the Wizard Model
Create a new model for your wizard in a Python file:
from odoo import models, fields, api
class YourWizard(models.TransientModel):
_name = 'your.module.wizard'
_description = 'Your Custom Wizard'
# Add your wizard fields here
name = fields.Char(string="Name", required=True)
Create the Wizard View
Define the XML view for your wizard in a view file:
<record id="view_your_wizard_form" model="ir.ui.view">
<field name="name">your.module.wizard.form</field>
<field name="model">your.module.wizard</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="name"/>
</group>
</sheet>
<footer>
<button name="confirm" string="Confirm" type="object" class="btn-primary"/>
<button string="Cancel" class="btn-secondary" special="cancel"/>
</footer>
</form>
</field>
</record>
Add the Button to Your Target View
<record id="view_your_model_form" model="ir.ui.view">
<field name="name">your.model.form</field>
<field name="model">your.model</field>
<field name="arch" type="xml">
<form>
<header>
<button name="open_wizard" string="Open Wizard" type="object" class="btn-primary"/>
</header>
<!-- Your existing form content -->
</form>
</field>
</record>
Define the Button Action
Create a method to open the wizard on the view’s corresponding model.
def open_wizard(self):
return {
'name': 'Your Wizard',
'type': 'ir.actions.act_window',
'res_model': 'your.module.wizard',
'view_mode': 'form',
'target': 'new',
}
Update Your Module
Update your __manifest__.py to include the new files and restart Odoo.