[IMP] hr_timesheet: Improve general UX (back2basics)
Change of several labels to increase consistency. Adapt the size of certain images so that they are rendered without modifying their quality. Display the employee's profile image in the grid view to improve the visual. Add the kanban view to the All Timesheets menu. Modify the Time Off configurations so that the projects displayed are those of a company and that the tasks are adapted according to the chosen project and vice versa. Make the hr_timesheet and timesheet_grid module icon the same for better consistency. closes odoo/odoo#51808 Taskid: 2239802 Related: odoo/enterprise#10745 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
committed by
Yannick Tivisse
parent
1c058b72d8
commit
bdf29635fb
@@ -11,9 +11,7 @@
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Record a new activity
|
||||
</p><p>
|
||||
You can register and track your workings hours by project every
|
||||
day. Every time spent on a project will become a cost and can be re-invoiced to
|
||||
customers if required.
|
||||
Track your working hours by projects every day and invoice this time to your customers.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
@@ -56,9 +54,7 @@
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Record a new activity
|
||||
</p><p>
|
||||
You can register and track your workings hours by project every
|
||||
day. Every time spent on a project will become a cost and can be re-invoiced to
|
||||
customers if required.
|
||||
Track your working hours by projects every day and invoice this time to your customers.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
@@ -101,9 +97,7 @@
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Record a new activity
|
||||
</p><p>
|
||||
You can register and track your workings hours by project every
|
||||
day. Every time spent on a project will become a cost and can be re-invoiced to
|
||||
customers if required.
|
||||
Track your working hours by projects every day and invoice this time to your customers.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<tree editable="top" string="Timesheet Activities">
|
||||
<field name="date"/>
|
||||
<field name="project_id" required="1" options="{'no_create_edit': True}" context="{'form_view_ref': 'project.project_project_view_form_simplified',}"/>
|
||||
<field name="task_id" optional="show" options="{'no_create_edit': True}" widget="task_with_hours" context="{'default_project_id': project_id}" domain="[('project_id', '=', project_id)]"/>
|
||||
<field name="task_id" optional="show" options="{'no_create_edit': True, 'no_open': True}" widget="task_with_hours" context="{'default_project_id': project_id}" domain="[('project_id', '=', project_id)]"/>
|
||||
<field name="name" optional="show" required="0"/>
|
||||
<field name="unit_amount" optional="show" widget="timesheet_uom" sum="Total" decoration-danger="unit_amount > 24"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
@@ -158,6 +158,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_kanban_mobile">
|
||||
<field name="date"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="name"/>
|
||||
<field name="project_id"/>
|
||||
@@ -168,7 +169,7 @@
|
||||
<div t-attf-class="oe_kanban_global_click">
|
||||
<div class="row">
|
||||
<div class="col-2">
|
||||
<img t-att-src="kanban_image('res.users', 'image_128', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" class="oe_kanban_avatar o_image_40_cover float-left"/>
|
||||
<img t-att-src="kanban_image('hr.employee', 'image_128', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value" class="o_image_40_cover float-left"/>
|
||||
</div>
|
||||
<div class="col-10">
|
||||
<div>
|
||||
@@ -203,7 +204,7 @@
|
||||
<record id="act_hr_timesheet_line" model="ir.actions.act_window">
|
||||
<field name="name">My Timesheets</field>
|
||||
<field name="res_model">account.analytic.line</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">tree,form,kanban</field>
|
||||
<field name="domain">[('project_id', '!=', False), ('user_id', '=', uid)]</field>
|
||||
<field name="context">{
|
||||
"search_default_week":1,
|
||||
@@ -213,9 +214,7 @@
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Record a new activity
|
||||
</p><p>
|
||||
You can register and track your workings hours by project every
|
||||
day. Every time spent on a project will become a cost and can be re-invoiced to
|
||||
customers if required.
|
||||
Track your working hours by projects every day and invoice this time to your customers.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
@@ -265,6 +264,7 @@
|
||||
<record id="timesheet_action_all" model="ir.actions.act_window">
|
||||
<field name="name">All Timesheets</field>
|
||||
<field name="res_model">account.analytic.line</field>
|
||||
<field name="view_mode">tree,form,pivot,kanban</field>
|
||||
<field name="search_view_id" ref="hr_timesheet_line_search"/>
|
||||
<field name="domain">[('project_id', '!=', False)]</field>
|
||||
<field name="context">{
|
||||
@@ -274,9 +274,7 @@
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Record a new activity
|
||||
</p><p>
|
||||
You can register and track your workings hours by project every
|
||||
day. Every time spent on a project will become a cost and can be re-invoiced to
|
||||
customers if required.
|
||||
Track your working hours by projects every day and invoice this time to your customers.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
@@ -302,6 +300,13 @@
|
||||
<field name="act_window_id" ref="timesheet_action_all"/>
|
||||
</record>
|
||||
|
||||
<record id="timesheet_action_view_all_kanban" model="ir.actions.act_window.view">
|
||||
<field name="view_mode">kanban</field>
|
||||
<field name="sequence">7</field>
|
||||
<field name="view_id" ref="hr_timesheet.view_kanban_account_analytic_line"/>
|
||||
<field name="act_window_id" ref="timesheet_action_all"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="timesheet_menu_activity_all"
|
||||
name="All Timesheets"
|
||||
parent="menu_hr_time_tracking"
|
||||
|
||||
@@ -13,9 +13,7 @@
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Record a new activity
|
||||
</p><p>
|
||||
You can register and track your workings hours by project every
|
||||
day. Every time spent on a project will become a cost and can be re-invoiced to
|
||||
customers if required.
|
||||
Track your working hours by projects every day and invoice this time to your customers.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." groups="base.group_multi_company"/>
|
||||
<div class="row">
|
||||
<div class="text-muted col-md-12">
|
||||
Set the time unit used to record your timesheets
|
||||
Time unit used to record your timesheets
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-group">
|
||||
@@ -46,10 +46,10 @@
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_project_timesheet_synchro" widget="upgrade_boolean"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<div style="width:130%" class="o_setting_right_pane">
|
||||
<label for="module_project_timesheet_synchro"/>
|
||||
<div class="text-muted">
|
||||
Synchronize time spent with our web/mobile apps
|
||||
Track your time from anywhere, even offline, with our web/mobile apps
|
||||
</div>
|
||||
<div class="content-group">
|
||||
<div class="row mt16 oe_center">
|
||||
@@ -74,7 +74,7 @@
|
||||
</div>
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<div class="o_setting_right_pane">
|
||||
<strong>Round timesheets</strong>
|
||||
<strong>Round Timesheets</strong>
|
||||
<div class="o_row w-30">
|
||||
<span class="o_light_label"><label for="timesheet_min_duration"/><field name="timesheet_min_duration" class="col-lg-2"/> minutes</span>
|
||||
</div>
|
||||
@@ -93,6 +93,7 @@
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="module_project_timesheet_holidays"/>
|
||||
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." groups="base.group_multi_company"/>
|
||||
<div class="text-muted">
|
||||
Create timesheets upon time off validation
|
||||
</div>
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<search string="timesheet attendance">
|
||||
<field name="user_id"/>
|
||||
<filter name="month" string="Date" date="date"/>
|
||||
<filter name="group_by_month" string="Date" date="date" context="{'group_by': 'date'}"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -17,19 +18,19 @@
|
||||
<field name="arch" type="xml">
|
||||
<pivot string="timesheet attendance" disable_linking="True">
|
||||
<field name="date" interval="month" type="row"/>
|
||||
<field name="total_difference" type="measure" widget="float_time"/>
|
||||
<field name="total_timesheet" type="measure" widget="float_time"/>
|
||||
<field name="total_attendance" type="measure" widget="float_time"/>
|
||||
<field name="total_timesheet" type="measure" widget="float_time"/>
|
||||
<field name="total_difference" type="measure" widget="float_time"/>
|
||||
</pivot>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_hr_timesheet_attendance_report" model="ir.actions.act_window">
|
||||
<field name="name">HR Timesheet/Attendance Report</field>
|
||||
<field name="name">Timesheet / Attendance</field>
|
||||
<field name="res_model">hr.timesheet.attendance.report</field>
|
||||
<field name="view_mode">pivot</field>
|
||||
<field name="view_mode">graph,pivot</field>
|
||||
<field name="view_id" ref="view_hr_timesheet_attendance_report_pivot"/>
|
||||
<field name="context">{'search_default_week': True}</field>
|
||||
<field name="context">{'search_default_group_by_month': True}</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_hr_timesheet_attendance_report"
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models,api
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class ResConfigSettings(models.TransientModel):
|
||||
_inherit = 'res.config.settings'
|
||||
|
||||
leave_timesheet_project_id = fields.Many2one(related='company_id.leave_timesheet_project_id', string="Internal Project", domain="[('company_id', '=', company_id)]", readonly=False)
|
||||
leave_timesheet_task_id = fields.Many2one(related='company_id.leave_timesheet_task_id', string="Time Off Task", domain="[('company_id', '=', company_id)]", readonly=False)
|
||||
leave_timesheet_project_id = fields.Many2one(
|
||||
related='company_id.leave_timesheet_project_id', required=True, string="Internal Project",
|
||||
domain="[('company_id', '=', company_id)]", readonly=False)
|
||||
leave_timesheet_task_id = fields.Many2one(
|
||||
related='company_id.leave_timesheet_task_id', string="Time Off Task", readonly=False,
|
||||
domain="[('company_id', '=', company_id), ('project_id', '=?', leave_timesheet_project_id)]")
|
||||
|
||||
@api.onchange('leave_timesheet_project_id')
|
||||
def _onchange_timesheet_project_id(self):
|
||||
|
||||
Reference in New Issue
Block a user