If you want to create dynamic view in Odoo-9 me have to move on .xml file and In dynamic view we can manage view from xml.file in Odoo module, for example you can see below code .
<record model="ir.ui.view" id="session_tree">
<field name="name">session tree</field>
<field name="model">session</field>
<field name="arch" type="xml">
<tree string="Session">
<field name="name">
<field name="start_date">
<field name="duration">
<field name="seat">
<field name="attendee1">
<field name="instructor">
<field name="course">
</field></field></field></field></field></field></field></tree>
</field>
</record>
<record id="action_courses" model="ir.actions.act_window">
<field name="name">Courses</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">course</field>
<field name="view_type">form</field>
<field name="view_id" ref="course_tree">
<field name="view_mode">tree,form</field>
</field></record>
<record id="action_attendee" model="ir.actions.act_window">
<field name="name">Attendee</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">attendee</field>
<field name="view_type">form</field>
<field name="view_id" ref="attendee_tree">
<field name="view_mode">tree,form</field>
</field></record>
<record id="action_session" model="ir.actions.act_window">
<field name="name">Session</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">session</field>
<field name="view_type">form</field>
<field name="view_id" ref="session_tree">
<field name="view_mode">tree,form</field>
</field></record>
<menuitem id="menu_course_main" name="Academy">
<menuitem id="menu_course_main2" parent="menu_course_main" name="Academy">
<menuitem id="menu_course_child1" parent="menu_course_main2" name="Courses" action="action_courses">
<menuitem id="menu_attendee_child1" parent="menu_course_main2" name="Attendee" action="action_attendee">
<menuitem id="menu_session_child1" parent="menu_course_main2" name="Session" action="action_session">
</menuitem></menuitem></menuitem></menuitem></menuitem>
Note-> With the help of this code we can easly manage .xml file in dynamic view.
0 Comment(s)