[FIX] product_extended: price from bom is build for product templates
[odoo/odoo.git] / addons / hr_timesheet_sheet / hr_timesheet_sheet_view.xml
index f3e3af5..afe10cb 100644 (file)
@@ -6,7 +6,7 @@
             <field name="name">hr.timesheet.account.form</field>
             <field name="model">hr_timesheet_sheet.sheet.account</field>
             <field name="arch" type="xml">
-                <form string="Timesheet by Accounts" version="7.0">
+                <form string="Timesheet by Accounts">
                     <group col="4">
                         <field name="sheet_id"/>
                         <field name="name" groups="analytic.group_analytic_accounting"/>
@@ -61,7 +61,7 @@
             <field name="name">hr.timesheet.sheet.form</field>
             <field name="model">hr_timesheet_sheet.sheet</field>
             <field name="arch" type="xml">
-                <form string="Timesheet" version="7.0">
+                <form string="Timesheet">
                 <header>
                     <button name="button_confirm" states="draft" string="Submit to Manager" type="object" class="oe_highlight"/>
                     <button name="done" states="confirm" string="Approve" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
                     <div class="oe_right oe_button_box" name="buttons">
                         <button type="action"
                             name="%(act_hr_timesheet_sheet_sheet_2_hr_analytic_timesheet)d"
-                            string="Timesheet Activities" />
+                            class="oe_stat_button"
+                            icon="fa-clock-o">
+                            <field name="timesheet_activity_count" widget="statinfo" string="Timesheet" help="Timesheet Activities"/>
+                        </button>
                         <button type="action" groups="base.group_hr_attendance"
-                            name="%(act_hr_timesheet_sheet_sheet_2_hr_attendance)d"
-                            string="Attendances" />
+                            class="oe_stat_button" icon="fa-users"
+                            name="%(act_hr_timesheet_sheet_sheet_2_hr_attendance)d">
+                            <field name="attendance_count" widget="statinfo" string="Attendances"/>
+                        </button>
                     </div>
                     <div class="oe_title">
                         <label for="employee_id" class="oe_edit_only"/>
                         <h1><field name="employee_id" on_change="onchange_employee_id(employee_id)" class="oe_inline"/></h1>
+                        <field name="user_id" invisible="1"/>
                     </div>
                     <group>
                         <group>
                             <field name="total_attendance" widget="float_time"/>
                             <field name="total_timesheet" widget="float_time"/>
                             <field name="total_difference" widget="float_time"/>
-                            <field name="user_id" invisible="1"/>
                         </group>
                     </group>
                     <notebook>
-                        <page string="Weekly">
-                            <widget type="weekly_timesheet">
+                        <page string="Summary">
+                            <widget type="weekly_timesheet" attrs="{'readonly': [['state', 'not in', ['new', 'draft']]]}">
                             </widget>
                         </page>
-                        <page string="Daily">
-                            <field context="{'user_id':user_id}" name="timesheet_ids" nolabel="1">
+                        <page string="Details">
+                            <field context="{'employee_id': employee_id, 'user_id':user_id, 'timesheet_date_from': date_from, 'timesheet_date_to': date_to}" name="timesheet_ids" nolabel="1">
                                 <tree editable="top" string="Timesheet Activities">
                                     <field name="date"/>
                                     <field domain="[('type','in',['normal', 'contract']), ('state', '&lt;&gt;', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id, user_id)" context="{'default_use_timesheets': 1}"/>
                                     <field name="name"/>
-                                    <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" widget="float_time" string="Hours"/>
+                                    <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" widget="float_time" string="Hours" sum="Hours"/>
                                     <field name="to_invoice" widget="selection"/>
                                     <field invisible="1" name="journal_id"/>
                                     <field invisible="1" name="product_id" domain="[('type','=','service')]" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)"/>
                                     <field invisible="1" name="general_account_id"/>
                                     <field invisible="1" name="user_id" required="1"/>
                                 </tree>
-                                <form string="Timesheet Activities" version="7.0">
+                                <form string="Timesheet Activities">
                                     <field name="date"/>
                                     <field domain="[('type','=','normal'), ('state', '&lt;&gt;', 'close')]" name="account_id" on_change="on_change_account_id(account_id, user_id)"/>
                                     <field name="name"/>
                         </page>
                         <page string="Attendances" groups="base.group_hr_attendance">
                             <group>
-                                <field context="{'user_id':user_id}" name="attendances_ids" nolabel="1">
+                                <field context="{'default_employee_id': employee_id, 'user_id':user_id}" name="attendances_ids" nolabel="1">
                                     <tree string="Attendances" editable="bottom">
                                         <field name="name"/>
                                         <field name="action"/>
                             <field name="period_ids">
                                 <tree colors="red:total_difference&lt;0.1;blue:total_difference&gt;=0.1" string="Period">
                                     <field name="name"/>
-                                    <field name="total_attendance" widget="float_time"/>
-                                    <field name="total_timesheet" widget="float_time"/>
-                                    <field name="total_difference" widget="float_time"/>
+                                    <field name="total_attendance" widget="float_time" sum="Attendances"/>
+                                    <field name="total_timesheet" widget="float_time" sum="Timesheets"/>
+                                    <field name="total_difference" widget="float_time" sum="Differences"/>
                                 </tree>
                             </field>
                         </page>
                     </notebook>
                 </sheet>
                 <div class="oe_chatter">
-                    <field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
+                    <field name="message_ids" widget="mail_thread"/>
                     <field name="message_follower_ids" widget="mail_followers"/>
                 </div>
                 </form>
                     <filter name="to_approve" string="To Approve" domain="[('state','=','confirm')]" help="Confirmed Timesheets"/>
                     <field name="employee_id"/>
                     <field name="department_id"/>
-                    <group expand="0" string="Group By...">
+                    <group expand="0" string="Group By">
                         <filter string="Employees" icon="terp-personal" domain="[]" context="{'group_by':'employee_id'}"/>
                         <filter string="Department" icon="terp-personal+" domain="[]" context="{'group_by':'department_id'}"/>
                     </group>
         </record>
 
         <act_window
-        context="{'search_default_sheet_id': [active_id]}"
-        id="act_hr_timesheet_sheet_sheet_by_account"
-        name="Timesheet by Account"
-        res_model="hr_timesheet_sheet.sheet.account"
-        src_model="hr_timesheet_sheet.sheet"/>
+            context="{'search_default_sheet_id': [active_id]}"
+            id="act_hr_timesheet_sheet_sheet_by_account"
+            name="Timesheet by Account"
+            groups="base.group_hr_attendance"
+            res_model="hr_timesheet_sheet.sheet.account"
+            src_model="hr_timesheet_sheet.sheet"/>
 
         <act_window
-        context="{'search_default_sheet_id': [active_id]}"
-        id="act_hr_timesheet_sheet_sheet_by_day"
-        name="Timesheet by Day"
-        res_model="hr_timesheet_sheet.sheet.day"
-        src_model="hr_timesheet_sheet.sheet"/>
+            context="{'search_default_sheet_id': [active_id]}"
+            id="act_hr_timesheet_sheet_sheet_by_day"
+            name="Timesheet by Day"
+            groups="base.group_hr_attendance"
+            res_model="hr_timesheet_sheet.sheet.day"
+            src_model="hr_timesheet_sheet.sheet"/>
+
         <record id="hr_timesheet_sheet_tree_simplified" model="ir.ui.view">
             <field name="name">hr.timesheet.sheet.tree</field>
             <field name="model">hr_timesheet_sheet.sheet</field>
                     <field name="employee_id"/>
                     <field name="date_from"/>
                     <field name="date_to"/>
-                    <field name="department_id"/>
+                    <field name="department_id" invisible="1"/>
                     <field name="total_attendance" widget="float_time" groups="base.group_hr_attendance"/>
                     <field name="total_timesheet" widget="float_time"/>
                     <field name="total_difference" widget="float_time" groups="base.group_hr_attendance"/>
             <field name="inherit_id" ref="hr_timesheet.hr_timesheet_employee_extd_form"/>
             <field name="arch" type="xml">
                 <xpath expr="//div[@name='button_box']" position="inside">
-                    <button name="%(act_hr_employee_2_hr_timesheet)d" string="Timesheets" type="action" groups="base.group_hr_manager"/>
+                    <button name="%(act_hr_employee_2_hr_timesheet)d" 
+                        type="action"
+                        class="oe_stat_button"
+                        icon="fa-clock-o" 
+                        groups="base.group_hr_manager">
+                        <field name="timesheet_count" widget="statinfo" string="Timesheets"/>
+                    </button>
                 </xpath>
             </field>
         </record>