This question has been flagged
2 Replies
12377 Views

How to create wizards in odoo12 Community Version

How to implement it...

Thanks in Advance...

Avatar
Discard
Best Answer

Hi,

For creating a wizard first you can define a transient model in the system.


class TestReport(models.TransientModel):
_name = 'test.report'

date_from = fields.Date(string='From')
date_to = fields.Date(string='To')


Then you can define the view in XML as follows,

<record id="view_test_report_wizard" model="ir.ui.view">
<field name="name">Test Report</field>
<field name="model">test.report</field>
<field name="arch" type="xml">
<form string="Choose The Details">
<group>
<group>
<field name="date_from" />
<field name="date_to"/>
</group>
</group>
<footer>
<button name="test_report" string="Print" type="object" class="oe_highlight" />
or
<button string="Cancel" class="oe_link" special="cancel"/>
</footer>
</form>
</field>
</record>

Also, Please see this link for more: How To create wizards in odoo ?

Thanks

Avatar
Discard
Author

Thank You