Open wizard on button click in odoo
- Create form view (for wizard)
- Create window action (for wizard)
- Create a button in your XML file from where you want to open a wizard on button click.
Create form view (for wizard)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<record model="ir.ui.view" id="view_any_name_form"> | |
<field name="name">any.name.form</field> | |
<field name="model">your.model</field> | |
<field name="groups_id"></field> | |
<field name="type">form</field> | |
<field name="arch" type="xml"> | |
<form string="My Form"> | |
<sheet> | |
<group> | |
<field name="field_1"/> | |
</group> | |
<group col="4" colspan="4"> | |
<field name="field_2"/> | |
</group> | |
<group col="4" colspan="4"> | |
<field name="field_3"/> | |
<field name="field_4"/> | |
</group> | |
</sheet> | |
<footer> | |
<button name="added" type="object" string="Add" class="oe_highlight"/> | |
or | |
<button special="cancel" string="Cancel"/> | |
</footer> | |
</form> | |
</field> | |
</record> |
Create window action (for wizard)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<record model="ir.actions.act_window" id="action_any_name_goes_here"> | |
<field name="name">My Action</field> | |
<field name="res_model">your.model</field> | |
<field name="view_type">form</field> | |
<field name="view_mode">form</field> | |
<field name="target">new</field> | |
</record> |
Create a button in your XML file from where you want to open a wizard on button click
Don,t forgot to share, keep sharing keep learning
5 Comments
tks! <3
ReplyDeleteyou are welcome
Deletethank you!
ReplyDeleteWhat about when your button is next to Create/Import?
ReplyDeletethan you must use javascript to implement your button logic
Delete