Search 1.9 billion lines of Odoo code on GitHub

multi_step_wizard

Author: Camptocamp,Odoo Community Association (OCA)
License: AGPL-3
Branch: merge-branch-1305-11.0.1.25.0
Repository: camptocamp/connector-jira
Dependencies: base
Languages: PO File (39, 17.6%), Python (85, 38.3%), XML (23, 10.4%), and reStructuredText (75, 33.8%)
Other branches: 11.0, 11.0-ocabot-merge-pr-34-by-simahawk-bump-patch, merge-branch-1305-11.0.1.24.3, merge-branch-1305-11.0.1.26.0, merge-branch-1305-11.0.1.26.1, merge-branch-1305-11.0.1.26.2, merge-branch-1305-11.0.1.26.3, merge-branch-1305-11.0.1.26.5, merge-branch-1305-872_fix_tempo_jira_status_sync-ba465b56, merge-branch-1305-872_fix_tempo_jira_status_sync_2-91790080, merge-branch-1305-c2c-956_jira_epic_link_on_epic-f34e683f, merge-branch-1305-c2c-958_hours_block_servicedesk_url-1c1fec1a, merge-branch-1305-c2c-958_hours_block_servicedesk_url-34c9a34a, merge-branch-1305-c2c-958_hours_block_servicedesk_url-83bb03df, merge-branch-1305-c2c-958_hours_block_servicedesk_url-87d645d6, and merge-branch-1305-c2c-958_hours_block_servicedesk_url-efd6ab82
Other repositories: ERPLibre/connector-jira, NeatNerdPrime/connector-jira, OCA/connector-jira, SeuMarco/connector-jira, brainbeanapps/connector-jira, dingguijin/connector-jira, grindtildeath/connector-jira, guewen/connector-jira-1, i-vyshnevska/connector-jira, jcoux/connector-jira, leemannd/connector-jira, leonelfolmer/connector-jira, lideritjnma/connector-jira, magnuscolors/connector-jira, and tegin/connector-jira

<h1 class="title">Multi Steps Wizards</h1> <p>This module is a base for creating multi-steps wizards. It does nothing by itself.</p> <p>Example of class:</p> <pre> <code>class MyWizard(models.TransientModel): _name = 'my.wizard' _inherit = ['multi.step.wizard.mixin'] project_id = fields.Many2one( comodel_name='project.project', name=&quot;Project&quot;, required=True, ondelete='cascade', default=lambda self: self._default_project_id(), ) name = fields.Char() field1 = fields.Char() field2 = fields.Char() field3 = fields.Char() &#64;api.model def _selection_state(self): return [ ('start', 'Start'), ('configure', 'Configure'), ('custom', 'Customize'), ('final', 'Final'), ] &#64;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'</code> </pre> <p>Example of view (note the mode, must be primary):</p> <pre> <code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;odoo&gt; &lt;record id=&quot;my_wizard_form&quot; model=&quot;ir.ui.view&quot;&gt; &lt;field name=&quot;name&quot;&gt;my.wizard.form&lt;/field&gt; &lt;field name=&quot;model&quot;&gt;my.wizard&lt;/field&gt; &lt;field name=&quot;mode&quot;&gt;primary&lt;/field&gt; &lt;field name=&quot;inherit_id&quot; ref=&quot;multi_step_wizard.multi_step_wizard_form&quot;/&gt; &lt;field name=&quot;arch&quot; type=&quot;xml&quot;&gt; &lt;xpath expr=&quot;//footer&quot; position=&quot;before&quot;&gt; &lt;h1&gt; &lt;field name=&quot;name&quot; attrs=&quot;{'readonly': [('state', '!=', 'start')]}&quot; class=&quot;oe_inline&quot; placeholder=&quot;Name&quot;/&gt; &lt;/h1&gt; &lt;group name=&quot;configure&quot; attrs=&quot;{'invisible': [('state', '!=', 'configure')]}&quot;&gt; &lt;group&gt; &lt;field name=&quot;field1&quot;/&gt; &lt;field name=&quot;field2&quot;/&gt; &lt;/group&gt; &lt;/group&gt; &lt;group name=&quot;custom&quot; attrs=&quot;{'invisible': [('state', '!=', 'custom')]}&quot;&gt; &lt;group&gt; &lt;field name=&quot;field3&quot;/&gt; &lt;/group&gt; &lt;/group&gt; &lt;div name=&quot;final&quot; attrs=&quot;{'invisible': [('state', '!=', 'final')]}&quot;&gt; &lt;p&gt;The project is now configured.&lt;/p&gt; &lt;/div&gt; &lt;/xpath&gt; &lt;/field&gt; &lt;/record&gt; &lt;act_window id=&quot;open_my_wizard&quot; name=&quot;My Wizard&quot; res_model=&quot;my.wizard&quot; src_model=&quot;project.project&quot; view_mode=&quot;form&quot; target=&quot;new&quot; view_type=&quot;form&quot; /&gt; &lt;/odoo&gt;</code> </pre>