[MERGE] merge with dev-addons3 branch
[odoo/odoo.git] / addons / hr_timesheet_sheet / hr_timesheet_sheet_view.xml
index 21f4775..35c20fd 100644 (file)
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <openerp>
     <data>
-        <!-- Editable current timesheet used  in dashboard-->
         <record id="hr_timesheet_sheet_tree" model="ir.ui.view">
             <field name="name">hr.timesheet.sheet.tree</field>
             <field name="model">hr_timesheet_sheet.sheet</field>
                 <tree string="Timesheets"
                     colors="blue:state == 'draft';grey:state == 'done'">
                     <field name="user_id"/>
-                    <field name="department_id"/>
                     <field name="date_from"/>
                     <field name="date_to"/>
                     <field name="name"/>
+                    <field name="department_id"/>
                     <field name="total_attendance" groups="hr_attendance.group_hr_attendance"/>
                     <field name="total_timesheet"/>
                     <field name="total_difference" groups="hr_attendance.group_hr_attendance"/>
                 </tree>
             </field>
         </record>
-
+       <record id="hr_timesheet_sheet_graph" model="ir.ui.view">
+         <field name="name">hr.timesheet.sheet.graph</field>
+         <field name="model">hr_timesheet_sheet.sheet</field>
+         <field name="type">graph</field>
+         <field name="arch" type="xml">
+             <graph string="Timesheets" type="bar">
+                 <field name="name"/>
+                 <field name="total_attendance" operator="+"/>
+                 <field name="total_timesheet" operator="+"/>
+             </graph>
+         </field>
+        </record>
         <record id="hr_timesheet_account_form" model="ir.ui.view">
             <field name="name">hr.timesheet.account.form</field>
             <field name="model">hr_timesheet_sheet.sheet.account</field>
@@ -31,7 +41,7 @@
                     <field name="sheet_id" select="1"/>
                     <field name="name" select="1"/>
                     <field name="total" sum="Total"/>
-                    <field name="invoice_rate" select="2"/>
+                    <field name="invoice_rate"/>
                 </form>
             </field>
         </record>
                     <field name="date_from"/>
                     <field name="date_to"/>
                     <field name="company_id" select="1" groups="base.group_multi_company"/>
-                    <field name="department_id"/>
+                    <field name="department_id" groups="base.group_extended"/>
                     <notebook colspan="4">
                         <page string="Daily View">
                             <group col="6" colspan="4">
                             </group>
 
                             <field colspan="3" context="name=date_current,user_id=user_id" height="100" name="attendances_ids" nolabel="1" groups="hr_attendance.group_hr_attendance">
-                                <tree string="Attendances">
+                                <tree string="Attendances" editable="bottom">
                                     <field name="name"/>
                                     <field name="action"/>
                                     <field invisible="1" name="employee_id"/>
             <field name="arch" type="xml">
                 <search string="Search Timesheet">
                     <group col="10" colspan="4">
-                        <filter icon="terp-crm" string="Unvalidated" domain="[('state','in',('draft', 'new'))]" help="Unvalidated Timesheets"/>
-                        <filter icon="terp-crm" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Timesheets"/>
+                        <filter icon="terp-crm" string="In Draft" domain="[('state','in',('draft', 'new'))]" help="Unvalidated Timesheets"/>
+                        <filter icon="terp-crm" string="To Validate" domain="[('state','=','confirm')]" help="Confirmed Timesheets"/>
                         <separator orientation="vertical"/>
-                        <field name="state" />
-                        <field name="name" select="1"/>
-                        <field name="user_id" select="1" widget="selection">
-                            <filter icon="terp-partner" domain="[('user_id','=',uid)]" help="My Timesheet"/>
-                        </field>
+                        <field name="user_id" select="1" widget="selection"/>
+                        <field name="date_from"/>
                         <field name="department_id" widget="selection">
                             <filter icon="terp-crm"
                                 domain="[('department_id','=',context.get('department_id',False))]"
                         </field>
                     </group>
                     <newline/>
-                       <group expand="1" string="Group By..." colspan="4" col="20">
+                    <group expand="1" string="Group By...">
                         <filter string="Users" icon="terp-project" domain="[]" context="{'group_by':'user_id'}"/>
                         <filter string="Department" icon="terp-project" domain="[]" context="{'group_by':'department_id'}"/>
-                       </group>
+                    </group>
                 </search>
             </field>
         </record>
             <field name="res_model">hr_timesheet_sheet.sheet</field>
             <field name="view_type">form</field>
             <field name="view_id" eval="False"/>
+            <field name="context">{'search_default_my_timesheet':1, 'search_default_user_id':uid }</field>
             <field name="search_view_id" ref="view_hr_timesheet_sheet_filter"/>
         </record>
+
         <!--Time Tracking menu in project Management-->
         <menuitem icon="terp-project" id="base.menu_main_pm" name="Project Management" sequence="1"/>
           <menuitem
             <field name="inherit_id" ref="hr_attendance.view_attendance_form"/>
             <field name="arch" type="xml">
                 <field name="action_desc" position="after">
-                    <field name="sheet_id" select="2"/>
+                    <field name="sheet_id"/>
                 </field>
             </field>
         </record>
                 </field>
             </field>
         </record>
-        <record id="view_attendance_tree_who" model="ir.ui.view">
-            <field name="name">hr.attendance.tree</field>
-            <field name="model">hr.attendance</field>
-            <field name="type">tree</field>
-            <field name="inherit_id" ref="hr_attendance.view_attendance_who"/>
-            <field name="arch" type="xml">
-                <field name="action_desc" position="after">
-                    <field name="sheet_id"/>
-                </field>
-            </field>
-        </record>
 
         <act_window domain="[('sheet_id', '=', active_id)]" id="act_hr_timesheet_sheet_sheet_by_day" name="Timesheet by Account" res_model="hr_timesheet_sheet.sheet.account" src_model="hr_timesheet_sheet.sheet"/>
 <!--         <act_window domain="[('sheet_id', '=', active_id)]" id="act_hr_timesheet_sheet_sheet_by_account" name="Timesheet by Day" res_model="hr_timesheet_sheet.sheet.day" src_model="hr_timesheet_sheet.sheet"/>  -->
             </field>
         </record>
 
+       <!-- Timesheet Button on Employee Form -->
+       <act_window domain="[('user_id', '=', user_id)]" id="act_hr_employee_2_hr_timesheet" name="Timesheets" res_model="hr_timesheet_sheet.sheet" src_model="hr.employee"/>
+
     </data>
 </openerp>