[MERGE]:merged from trunk
[odoo/odoo.git] / addons / hr_timesheet / hr_timesheet_view.xml
index b8d4764..e5dbecd 100644 (file)
-<?xml version="1.0" ?>
-<terp>
-       <data>
-               <record model="ir.ui.view" id="hr_timesheet_line_tree">
-                       <field name="name">hr.analytic.timesheet.tree</field>
-                       <field name="model">hr.analytic.timesheet</field>
-                       <field name="type">tree</field>
-                       <field name="arch" type="xml">
-                               <tree string="Timesheet Line" editable="bottom">
-                                       <field name="user_id" required="1" on_change="on_change_user_id(user_id)"/>
-                                       <field name="date" />
-                                       <field name="account_id"  domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]"/>
-                    <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_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"/>
-                               </tree>
-                       </field>
-               </record>
-               <record model="ir.ui.view" id="hr_timesheet_line_form">
-                       <field name="name">hr.analytic.timesheet.form</field>
-                       <field name="model">hr.analytic.timesheet</field>
-                       <field name="type">form</field>
-                       <field name="arch" type="xml">
-                               <form string="Timesheet Lines">
-                                       <field name="name" colspan="4"/>
-                                       <field name="user_id" select="1" required="1" on_change="on_change_user_id(user_id)"/>
-                                       <field name="date" select="1"/>
-                                       <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_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" />
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <menuitem icon="terp-project" id="base.menu_main_pm" name="Project" sequence="10"/>
+        <menuitem id="base.menu_project_management_time_tracking" name="Time Tracking"
+                  parent="base.menu_main_pm" sequence="3"/>
 
-                                       <field name="account_id"  domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" select="1"/>
-                                       <field name="amount"  select="2"/>
-                    <field name="general_account_id"  select="2"/>
-                    <field name="journal_id"/>
-                               </form>
-                       </field>
-               </record>
+        <record id="hr_timesheet_line_tree" model="ir.ui.view">
+            <field name="name">hr.analytic.timesheet.tree</field>
+            <field name="model">hr.analytic.timesheet</field>
+            <field name="type">tree</field>
+            <field name="arch" type="xml">
+                <tree editable="bottom" string="Timesheet Lines">
+                    <field name="date" on_change="on_change_date(date)"/>
+                    <field name="user_id" on_change="on_change_user_id(user_id)" required="1"/>
+                    <field name="journal_id" invisible="1"/>
+                    <field name="name"/>
+                    <field domain="[('type','=','normal')]" name="account_id"/>
+                    <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" required="1" domain="[('type','=','service')]" invisible="1"/>
+                    <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" sum="Total time"/>
+                    <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" invisible="1"/>
+                    <field name="amount" sum="Total cost" invisible="1"/>
+                    <field name="general_account_id" invisible="1"/>
+                </tree>
+            </field>
+        </record>
+        <record id="hr_timesheet_line_form" model="ir.ui.view">
+            <field name="name">hr.analytic.timesheet.form</field>
+            <field name="model">hr.analytic.timesheet</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <form string="Timesheet Lines">
+                    <group colspan="4" col="6">
+                    <field name="name"/>
+                    <field name="user_id" on_change="on_change_user_id(user_id)" required="1" select="1"/>
+                    <field name="date" select="1" on_change="on_change_date(date)"/>
+                    </group>
+                    <notebook colspan="4">
+                        <page string="Information">
+                            <group colspan="2" col="2">
+                                <separator string="Product" colspan="2"/>
+                                <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" required="1" domain="[('type','=','service')]"/>
+                                <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)"/>
+                                <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)"/>
+                            </group>
+                            <group colspan="2" col="2">
+                                <separator string="Accounting" colspan="2"/>
+                                <field domain="[('type','=','normal'),('state', '&lt;&gt;', 'close'),('parent_id','!=',False)]" name="account_id" select="1" groups="base.group_extended"/>
+                                <field name="amount"/>
+                                <field name="general_account_id"/>
+                                <field name="journal_id"/>
+                            </group>
+                            <group colspan="2" col="2">
+                                <separator string="Invoicing" colspan="2"/>
+                            </group>
+                        </page>
+                    </notebook>
+                </form>
+            </field>
+        </record>
 
-               <record model="ir.actions.act_window" id="act_hr_timesheet_line_today_form">
-                        <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 name="Human Resources/Hours Encoding" id="menu_act_hr_timesheet_line_today_form" action="act_hr_timesheet_line_today_form" />
+        <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 name="today" icon="terp-go-today" domain="[('date', '=', time.strftime('%%Y-%%m-%%d'))]" string="Today"/>
+                        <separator orientation="vertical"/>
+                        <field name="user_id"/>
+                        <field name="account_id"/>
+                        <field name="date"/>
+                    </group>
+                    <newline/>
+                    <group expand="0" string="Group By...">
+                        <filter string="Users" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
+                        <separator orientation="vertical"/>
+                        <filter string="Anlytic account" icon="terp-folder-green" domain="[]" context="{'group_by':'account_id'}"/>
+                        <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
+                        <separator orientation="vertical"/>
+                        <filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
+                    </group>
+                </search>
+            </field>
 
-               <record model="ir.actions.act_window" id="act_hr_timesheet_line_me_today_form">
-                       <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 name="Human Resources/Hours Encoding/For me/My Works of the Day" id="menu_act_hr_timesheet_line_me_today_form" action="act_hr_timesheet_line_me_today_form" />
+        </record>
 
-               <record model="ir.actions.act_window" id="act_hr_timesheet_line_me_all_form">
-                       <field name="name">All my works</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>
-               </record>
-               <menuitem name="Human Resources/Hours Encoding/For me/All My Works" id="menu_act_hr_timesheet_line_me_all_form" action="act_hr_timesheet_line_me_all_form" />
+        <record id="act_hr_timesheet_line_evry1_all_form" model="ir.actions.act_window">
+            <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="context">{"search_default_user_id":uid, "search_default_today":1}</field>
+            <field name="search_view_id" ref="hr_timesheet_line_search"/>
+            <field name="help">Through Working Hours you can register your working hours by project every day.</field>
+        </record>
 
-               <record model="ir.actions.act_window" id="act_hr_timesheet_line_evry1_today_form">
-                       <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 name="Human Resources/Hours Encoding/For Everyone/All Works of the Day" id="menu_act_hr_timesheet_line_evry1_today_form" action="act_hr_timesheet_line_evry1_today_form" />
-               
-               <record model="ir.actions.act_window" id="act_hr_timesheet_line_evry1_all_form">
-                       <field name="name">All works</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>
-               </record>
-               <menuitem name="Human Resources/Hours Encoding/For Everyone/All Works" id="menu_act_hr_timesheet_line_evry1_all_form" action="act_hr_timesheet_line_evry1_all_form" />
+    <menuitem id="menu_project_working_hours" parent="base.menu_project_management_time_tracking" action="act_hr_timesheet_line_evry1_all_form"/>
+    <menuitem id="menu_hr_working_hours" parent="hr_attendance.menu_hr_time_tracking" action="act_hr_timesheet_line_evry1_all_form"/>
 
-               <record model="ir.ui.view" id="hr_timesheet_employee_extd_form">
-                       <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>
-                       </field>
-               </record>
-       </data>
-</terp>
+        <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">
+                <page string="Categories" position="after">
+                    <page string="Timesheets">
+                        <field name="product_id" domain="[('type','=','service')]"/>
+                        <field name="journal_id" widget="selection"/>
+                    </page>
+                </page>
+            </field>
+        </record>
+
+
+    </data>
+</openerp>