Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
13142 Lượt xem

How to create wizards in odoo12 Community Version

How to implement it...

Thanks in Advance...

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

Thank You