OdooWiki OCA HUB

Multi-Steps Wizards

multi_step_wizard folder_open OCA/server-ux open_in_new
Uncategorised License: AGPL-3

This module is a base for creating multi-steps wizards. It does nothing by itself.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

A technical building block that lets developers create wizards with several steps (Next / Go Back / Cancel) in Odoo. It adds no visible feature by itself; other modules use it to build step-by-step screens.

This module is a foundation for developers, not a business feature. It provides a reusable base (a mixin) called multi.step.wizard.mixin that other modules can build on to create wizards that guide users through several screens one after another.

What it defines: - A step indicator field (state) that tracks where the user is in the wizard, starting at "start" and ending at "final". - A computed flag (allow_back) that decides whether the "Go Back" button should be shown, based on whether a previous-step method exists for the current step. - Two navigation methods, open_next and open_previous, which call the step-specific logic and then reopen the same wizard window. - A default first step behaviour (state_exit_start) that simply moves to the final step.

The only screen it ships is a form view for multi.step.wizard.mixin, with a footer containing three buttons: "Next" (hidden on the final step), "Go Back" (hidden when going back is not possible) and "Cancel".

Because it depends only on base and does nothing on its own, users will not see any new menu or report after installing it. Its value appears only when another module inherits it to build a concrete multi-step wizard.

Depends on

base
Models and fields (1)
  • multi.step.wizard.mixin · new modelstate, allow_back

Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 7 confirmed, 2 with no information of 9 versions.

Sources · Odoo 18.0

Confirmed on 2026-11-03 in branch 18.0 of OCA/server-ux.

terminal Installation and usage

OCA documentation · Odoo 18.0

Example of class:

class MyWizard(models.TransientModel):
    _name = 'my.wizard'
    _inherit = ['multi.step.wizard.mixin']

    project_id = fields.Many2one(
        comodel_name='project.project',
        name="Project",
        required=True,
        ondelete='cascade',
        default=lambda self: self._default_project_id(),
    )
    name = fields.Char()
    field1 = fields.Char()
    field2 = fields.Char()
    field3 = fields.Char()

    @api.model
    def _selection_state(self):
        return [
            ('start', 'Start'),
            ('configure', 'Configure'),
            ('custom', 'Customize'),
            ('final', 'Final'),
        ]

    @api.model
    def _default_project_id(self):
        return self.env.context.get('active_id')

    def state_exit_start(self):
        self.state = 'configure'

    def state_exit_configure(self):
        self.state = 'custom'

    def state_exit_custom(self):
        self.state = 'final'

Example of view (note the mode, must be primary):

<?xml version="1.0" encoding="utf-8"?>
<odoo>

  <record id="my_wizard_form" model="ir.ui.view">
    <field name="name">my.wizard.form</field>
    <field name="model">my.wizard</field>
    <field name="mode">primary</field>
    <field name="inherit_id" ref="multi_step_wizard.multi_step_wizard_form"/>
    <field name="arch" type="xml">
      <xpath expr="//footer" position="before">
        <h1>
          <field name="name"
                readonly="state != 'start'"
                class="oe_inline"
                placeholder="Name"/>
        </h1>
        <group name="configure" invisible="state != 'configure'">
          <group>
            <field name="field1"/>
            <field name="field2"/>
          </group>
        </group>
        <group name="custom" invisible="state != 'custom'">
          <group>
            <field name="field3"/>
          </group>
        </group>
        <div name="final" invisible="state != 'final'">
          <p>The project is now configured.</p>
        </div>
      </xpath>
    </field>
  </record>

  <record id="open_my_wizard" model="ir.actions.act_window">
      <field name="name">My Wizard</field>
      <field name="res_model">my.wizard</field>
      <field name="view_mode">form</field>
      <field name="target">new</field>
      <field name="binding_model_id" ref="project.model_project_project" />
      <field name="binding_view_types">form</field>
  </record>
</odoo>

No verified information in OCA: Installation, Configuration.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.