Guest User

Untitled

a guest
Feb 18th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.91 KB | None | 0 0
  1. <?xml version="1.0"?>
  2. <!--mydev.xml-->
  3. <tryton>
  4.     <data>
  5.         <!-- View Tree for Theparent-->
  6.         <record model="ir.ui.view" id="mydev_view_tree">
  7.             <field name="model">mydev.theparent</field>
  8.             <field name="type">tree</field>
  9.             <field name="arch" type="xml">
  10.                 <![CDATA[
  11.                <tree string="Mydev The Parent">
  12.                     <field name="name" select="1"/>
  13.                     <field name="desc" />
  14.             <!--I knew here is the place to put records from Thechild,
  15.                 But How ?
  16.             -->
  17.                </tree>
  18.                ]]>
  19.             </field>
  20.         </record>
  21.  
  22.         <!-- View Form for Theparent-->
  23.        <record model="ir.ui.view" id="mydev_view_form">
  24.             <field name="model">mydev.theparent</field>
  25.             <field name="type">form</field>
  26.             <field name="arch" type="xml">
  27.               <![CDATA[
  28.              <form string="The Parent">
  29.                <label name="Parent Name"/>
  30.                <field name="name"/>
  31.                <label name="Parent Desc"/>
  32.                <field name="desc"/>
  33.              </form>
  34.              ]]>
  35.             </field>
  36.        </record>
  37.  
  38.         <!-- Each Model need to bound to an "action",
  39.         so let's create an action that bound to our model -->
  40.         <record model="ir.action.act_window" id="act_mydev_theparent_form">
  41.             <field name="name">The Parent</field>
  42.             <field name="res_model">mydev.theparent</field>
  43.         </record>
  44.  
  45.         <!--and bound the action to the 2 view we've created above-->      
  46.         <!-- First, bound that action to our view_tree-->
  47.         <record model="ir.action.act_window.view" id="act_mydev_theparent_view1">
  48.             <field name="sequence" eval="10"/>
  49.             <field name="view" ref="mydev_view_tree"/>
  50.             <field name="act_window" ref="act_mydev_theparent_form"/>
  51.         </record>
  52.  
  53.         <!-- And also bound the same action to our view_form-->
  54.         <record model="ir.action.act_window.view" id="act_mydev_theparent_view2">
  55.             <field name="sequence" eval="20"/>
  56.             <field name="view" ref="mydev_view_form"/>
  57.             <field name="act_window" ref="act_mydev_theparent_form"/>
  58.         </record>
  59.        
  60.         <!-- Here we play with "menu-->
  61.         <!-- First we position our module agains existing menu
  62.         For this example, we just put it at the first level of existing menu tree
  63.         -->
  64.         <menuitem name="My Dev" id="menu_mydev" sequence="10"/>
  65.  
  66.         <!-- While we playing with menu,
  67.         lets try to put another "sub menu" before the one that call real action -->
  68.         <menuitem name="Parent Child" parent="menu_mydev" sequence="1"
  69.            id="menu_mydev_parentchild"/>
  70.         <!-- Here is the one which call the real action-->
  71.         <menuitem parent="menu_mydev_parentchild" sequence="1"
  72.            id="menu_mydev_theparent_form" action="act_mydev_theparent_form"/>
  73.     </data>
  74. </tryton>
Add Comment
Please, Sign In to add comment