Skip to content

Instantly share code, notes, and snippets.

@3mrdev
Created June 8, 2021 23:41
Show Gist options
  • Save 3mrdev/7f1aead7530f56d9d34b169950d74f7e to your computer and use it in GitHub Desktop.
Save 3mrdev/7f1aead7530f56d9d34b169950d74f7e to your computer and use it in GitHub Desktop.
Odoo Wizards
from odoo import models, fields, api
class PopupWizard(models.TransientModel):
_name = 'popup.wizard'
title = fields.Char()
start_date = fields.Datetime()
def confirm(self):
pass
<odoo>
<data>
<record model="ir.ui.view" id="wizard_form">
<field name="name">Wizard Form</field>
<field name="model">popup.wizard</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Popup Wizard">
<group>
<group>
<field name="start_date"/>
<field name="end_date"/>
</group>
</group>
<footer>
<button name="confirm" string="Confirm" type="object" class="oe_highlight"/>
<button string="Cancel" special="cancel"/>
</footer>
</form>
</field>
</record>
<act_window id="action_popup_wizard"
name="Popup Wizard"
res_model="popup.wizard"
view_mode="form"
target="new"/>
<menuitem id="popup_wizard_menu" name="Popup Wizard" sequence="1" parent="your_module.your_menu" action="action_popup_wizard"/>
</data>
</odoo>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment