[REF]: Removed menu items 'New..' and 'My..' and also its related actions
[odoo/odoo.git] / addons / hr_timesheet / hr_timesheet_view.xml
index a9ebd1c..0650889 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<terp>
+<openerp>
     <data>
         <record id="hr_timesheet_line_tree" model="ir.ui.view">
             <field name="name">hr.analytic.timesheet.tree</field>
@@ -8,14 +8,15 @@
             <field name="arch" type="xml">
                 <tree editable="bottom" string="Timesheet Line">
                     <field name="user_id" on_change="on_change_user_id(user_id)" required="1"/>
-                    <field name="date"/>
+                    <field name="date" on_change="on_change_date(date)"/>
                     <field domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" name="account_id"/>
                     <field name="name"/>
                     <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" sum="Total time"/>
-                    <field name="product_id" required="1"/>
+                    <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" required="1" domain="[('type','=','service')]"/>
                     <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
                     <field name="amount" sum="Total cost"/>
                     <field name="general_account_id"/>
+                    <field name="journal_id"/>
                 </tree>
             </field>
         </record>
             <field name="type">form</field>
             <field name="arch" type="xml">
                 <form string="Timesheet Lines">
-                    <field colspan="4" name="name"/>
+                    <field colspan="4" name="name" select="2"/>
                     <field name="user_id" on_change="on_change_user_id(user_id)" required="1" select="1"/>
-                    <field name="date" select="1"/>
+                    <field name="date" select="1" on_change="on_change_date(date)"/>
                     <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
                     <newline/>
-                    <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" required="1"/>
+                    <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" required="1" domain="[('type','=','service')]"/>
                     <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
                     
                     <field domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" name="account_id" select="1"/>
             </field>
         </record>
         
-        <record id="act_hr_timesheet_line_today_form" model="ir.actions.act_window">
-            <field name="name">Hours Encoding</field>
-            <field name="type">ir.actions.act_window</field>
-            <field name="res_model">hr.analytic.timesheet</field>
-            <field name="view_type">form</field>
-            <field name="view_id" ref="hr_timesheet_line_tree"/>
-        </record>
-        <menuitem action="act_hr_timesheet_line_today_form" id="menu_act_hr_timesheet_line_today_form" parent="hr.menu_hr_root"/>
-        
-        <record id="act_hr_timesheet_line_me_today_form" model="ir.actions.act_window">
-            <field name="name">My works of the day</field>
-            <field name="type">ir.actions.act_window</field>
-            <field name="res_model">hr.analytic.timesheet</field>
-            <field name="view_type">form</field>
-            <field name="view_mode">tree,form</field>
-            <field name="domain">[('date', '=', time.strftime('%Y-%m-%d')),('user_id','=',uid)]</field>
-        </record>
-        <menuitem id="next_id_46" name="For me" parent="hr_timesheet.menu_act_hr_timesheet_line_today_form"/><menuitem action="act_hr_timesheet_line_me_today_form" id="menu_act_hr_timesheet_line_me_today_form" parent="next_id_46"/>
+        <record id="hr_timesheet_line_search" model="ir.ui.view">
+            <field name="name">hr.analytic.timesheet.search</field>
+            <field name="model">hr.analytic.timesheet</field>
+            <field name="type">search</field>
+            <field name="arch" type="xml">
+                <search string="Timesheet">
+                    <group col='8' colspan='4'>
+                           <filter icon="terp-hr" domain="[('date', '=', time.strftime('%%Y-%%m-%%d'))]" string="Today"/>
+                           <filter icon="terp-hr" domain="[('user_id','=',uid)]" string="My Work" help="My Work"/>
+                           <separator orientation="vertical"/>                    
+                           <field name="user_id" select="1" widget="selection"/>
+                           <field name="account_id" select="1" widget="selection"/>                    
+                           <field name="date" select="1"/>
+                    </group>
+                </search>
+            </field>
+        </record>        
+
+        <menuitem id="menu_act_hr_timesheet_line_today_form" parent="hr.menu_hr_root" name="Working Hours" />
         
         <record id="act_hr_timesheet_line_me_all_form" model="ir.actions.act_window">
-            <field name="name">All my works</field>
+            <field name="name">My Working Hours</field>
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">hr.analytic.timesheet</field>
             <field name="view_type">form</field>
             <field name="view_mode">tree,form</field>
             <field name="domain">[('user_id','=',uid)]</field>
+            <field name="filter" eval="True"/>
+            <field name="search_view_id" ref="hr_timesheet_line_search"/>
         </record>
-        <menuitem action="act_hr_timesheet_line_me_all_form" id="menu_act_hr_timesheet_line_me_all_form" parent="hr_timesheet.next_id_46"/>
-        
-        <record id="act_hr_timesheet_line_evry1_today_form" model="ir.actions.act_window">
-            <field name="name">All works of the day</field>
-            <field name="type">ir.actions.act_window</field>
-            <field name="res_model">hr.analytic.timesheet</field>
-            <field name="view_type">form</field>
-            <field name="view_mode">tree,form</field>
-            <field name="domain">[('date', '=',        time.strftime('%Y-%m-%d'))]</field>
-        </record>
-        <menuitem id="next_id_47" name="For Everyone" parent="hr_timesheet.menu_act_hr_timesheet_line_today_form"/><menuitem action="act_hr_timesheet_line_evry1_today_form" id="menu_act_hr_timesheet_line_evry1_today_form" parent="next_id_47"/>
-        
+
         <record id="act_hr_timesheet_line_evry1_all_form" model="ir.actions.act_window">
-            <field name="name">All works</field>
+            <field name="name">Working Hours</field>
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">hr.analytic.timesheet</field>
             <field name="view_type">form</field>
             <field name="view_mode">tree,form</field>
+            <field name="search_view_id" ref="hr_timesheet_line_search"/>            
         </record>
-        <menuitem action="act_hr_timesheet_line_evry1_all_form" id="menu_act_hr_timesheet_line_evry1_all_form" parent="hr_timesheet.next_id_47"/>
-        
+        <menuitem
+            action="act_hr_timesheet_line_evry1_all_form"
+            id="menu_act_hr_timesheet_line_evry1_all_form"
+            parent="hr_timesheet.menu_act_hr_timesheet_line_today_form"
+            groups="hr.group_hr_manager"/>
+
         <record id="hr_timesheet_employee_extd_form" model="ir.ui.view">
             <field name="name">hr.timesheet.employee.extd_form</field>
             <field name="model">hr.employee</field>
             <field name="inherit_id" ref="hr.view_employee_form"/>
             <field name="arch" type="xml">
-                <field name="notes" position="after">
-                    <field name="product_id"/>
-                    <field name="journal_id"/>
-                </field>
+                <notebook position="inside">
+                    <page string="Timesheets">
+                        <field name="product_id" domain="[('type','=','service')]"/>
+                        <field name="journal_id"/>
+                    </page>
+                </notebook>
             </field>
         </record>
     </data>
-</terp>
\ No newline at end of file
+</openerp>