Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0"?>
- <!--mydev.xml-->
- <tryton>
- <data>
- <!--
- There is 2 (basic/common) types of "view"
- 1. Tree View
- 2. Form View
- -->
- <!-- View Tree for Theparent-->
- <record model="ir.ui.view" id="mydev_view_tree">
- <field name="model">mydev.theparent</field>
- <field name="type">tree</field>
- <field name="arch" type="xml">
- <![CDATA[
- <tree string="Mydev The Parent">
- <field name="name" select="1"/>
- <field name="desc" />
- </tree>
- ]]>
- </field>
- </record>
- <!-- View Form for Theparent-->
- <record model="ir.ui.view" id="mydev_view_form">
- <field name="model">mydev.theparent</field>
- <field name="type">form</field>
- <field name="arch" type="xml">
- <![CDATA[
- <form string="The Parent">
- <label name="Parent Name"/>
- <field name="name"/>
- <label name="Parent Desc"/>
- <field name="desc"/>
- </form>
- ]]>
- </field>
- </record>
- <!-- Each Model need to bound to an "action",
- so let's create an action that bound to our model -->
- <record model="ir.action.act_window" id="act_mydev_theparent_form">
- <field name="name">The Parent</field>
- <field name="res_model">mydev.theparent</field>
- </record>
- <!--and bound the action to the 2 view we've created above-->
- <!-- First, bound that action to our view_tree-->
- <record model="ir.action.act_window.view" id="act_mydev_theparent_view1">
- <field name="sequence" eval="10"/>
- <field name="view" ref="mydev_view_tree"/>
- <field name="act_window" ref="act_mydev_theparent_form"/>
- </record>
- <!-- And also bound the same action to our view_form-->
- <record model="ir.action.act_window.view" id="act_mydev_theparent_view2">
- <field name="sequence" eval="20"/>
- <field name="view" ref="mydev_view_form"/>
- <field name="act_window" ref="act_mydev_theparent_form"/>
- </record>
- <!-- Here we play with "menu-->
- <!-- First we position our module agains existing menu
- For this example, we just put it at the first level of existing menu tree
- -->
- <menuitem name="My Dev" id="menu_mydev" sequence="10"/>
- <!-- While we playing with menu,
- lets try to put another "sub menu" before the one that call real action -->
- <menuitem name="Parent Child" parent="menu_mydev" sequence="1"
- id="menu_mydev_parentchild"/>
- <!-- Here is the one which call the real action-->
- <menuitem parent="menu_mydev_parentchild" sequence="1"
- id="menu_mydev_theparent_form" action="act_mydev_theparent_form"/>
- </data>
- </tryton>
Add Comment
Please, Sign In to add comment