Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MERGE] hr_timesheet: clean durations expressed in hours if encoding unit is in days #46184

Merged

Conversation

kitan191
Copy link
Contributor

@kitan191 kitan191 commented Feb 25, 2020

Purpose

There are several places where the duration is expressed in hours even though the encoding unit is in Days.

Specifications

The duration should be expressed in days instead of hours in the following places:
[x] Timesheet Entries
[x] Portal > Tickets
[x] Portal > Timesheets
[x] Portal > Tasks
[x] Portal > Sales Orders
[x] Project Overview
[x] Project task form view (in this case, the label of the field should be 'Planned Days')
[x] Timesheets > HR Timesheet/Attendence Report
[x] Project > All Tasks

Hide the following elements if the encoding unit is in days:
[x] 'Timesheet Timer' feature on the project form view
[x] 'Timesheet Timer' feature on the Helpdesk team form view
[x] the 'Round timesheets' feature in the settings of Timesheets (except if the 'Awesome Timesheet' feature is enabled)

Bonus point:
[x] Timesheet form view: 0.00 Days should be displayed in read-only if the duration = 0

Some labels need to be adapted to explicit the unit of measure (is it carrots? potatoes?): e.g. Duration (Days) or Time Spent (Hours) :
[x] Timesheet entries report
[x] on the portal
[x] Project overview: add 'recorded' next to Hours/Days
[x] Project overview: add 'Days/hours Spent' above the total by employee
[x] task form view: make sure the 'sub-tasks days spent' button/label stays on one line

[x] hide the 'start' button on project tasks and helpdesk tickets if the encoding unit is in days

Task ID : 2152322

@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses seen 🙂 labels Feb 25, 2020
@C3POdoo C3POdoo added the RD research & development, internal work label Feb 25, 2020
@kitan191 kitan191 force-pushed the master-timesheets-clean-day-duration-pta branch from b04b398 to 130f21b Compare February 25, 2020 10:19
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Feb 25, 2020
@kitan191 kitan191 force-pushed the master-timesheets-clean-day-duration-pta branch from 163483b to 3e7e092 Compare February 27, 2020 07:52
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Feb 27, 2020
@kitan191 kitan191 force-pushed the master-timesheets-clean-day-duration-pta branch from 57f278e to 70d31d1 Compare February 27, 2020 12:26
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Feb 27, 2020
@kitan191 kitan191 force-pushed the master-timesheets-clean-day-duration-pta branch from cab5fe5 to a6f0dae Compare February 28, 2020 10:20
@robodoo robodoo added the CI 🤖 Robodoo has seen passing statuses label Feb 28, 2020
@kitan191 kitan191 force-pushed the master-timesheets-clean-day-duration-pta branch from a6f0dae to 7271c2c Compare February 28, 2020 12:47
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Feb 28, 2020
@kitan191 kitan191 force-pushed the master-timesheets-clean-day-duration-pta branch from f607eb0 to 02c7915 Compare March 16, 2020 07:50
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Mar 16, 2020
@kitan191 kitan191 force-pushed the master-timesheets-clean-day-duration-pta branch from 02c7915 to 133e587 Compare March 26, 2020 07:26
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Mar 26, 2020
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Jul 3, 2020
@kitan191 kitan191 force-pushed the master-timesheets-clean-day-duration-pta branch from cb1fdf6 to 6a05566 Compare July 9, 2020 08:45
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Jul 9, 2020
@kitan191 kitan191 force-pushed the master-timesheets-clean-day-duration-pta branch from 6a05566 to ee26ef8 Compare July 9, 2020 09:11
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Jul 9, 2020
if is_uom_day:
# convert all times from hours to days
for time_type in ['non_billable_project', 'non_billable', 'billable_time', 'billable_fixed', 'canceled', 'total']:
if repartition_employee[employee_id][time_type] != 0.0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if repartition_employee[employee_id][time_type] != 0.0:
if repartition_employee[employee_id][time_type]:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@kitan191 kitan191 force-pushed the master-timesheets-clean-day-duration-pta branch from ee26ef8 to 74406b6 Compare July 16, 2020 07:01
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Jul 16, 2020
…gs of Timesheets if encoding unit is Days

[IMP] hr_timesheet: hide the "Timesheet Timer" feature in the project form if encoding unit is not Hours

[IMP] hr_timesheet: clean display of Days for timesheets

A computed field has to be added to retrieve the encoding uom of the current company and be used in the views.
FieldTimesheetFactor field has to be registered to "float_factor" widget for the "planned_hours" field to work correctly with Days
(for the conversion from hours to days to be computed and to be able to set a greater value than 1 day)

If encoding unit for timesheets is set to Days:
- Display Days instead of Hours in Portal > Timesheets
- Display Days instead of Hours in Portal > Tasks
- Display Days instead of Hours in Portal > Invoices & Bills
- Display Days instead of Hours in Portal > Tickets

[IMP] hr_timesheet: display clean duration in Timesheet Entries

Display Days instead of Hours in Timesheet Entries (print action) if encoding unit for timesheets is set to Days

[IMP] hr_timesheet: correctly display timesheets in Days if configured to

- correctly display remaining days in project.task kanban and list view
- hide timer start button if timesheet is configured in Days
- update several column names

[IMP] hr_timesheet: clean code

[IMP] hr_timesheet: small improvements when displaying timesheets in days

- Rename some labels
- Fixes style
- Prevent fields displayed with widget "timesheet_uom" to change when timer is on
- Display correctly "Initially Planned Days" field in task creation form
Display Days instead of Hours in "HR Timesheet/Attendance Report" if encoding unit for timesheets is set to Days
Display Days instead of Hours in project overview if encoding unit for timesheets is set to Days

[IMP] sale_timesheet: update some labels in Project Overview

[IMP] sale_timesheet: fix style in Project Overview

[IMP] sale_timesheet: clean code

[IMP] sale_timesheet: add some rounding in project overview
The field was hidden in UI when its value was not set or equal to 0.

Display the field if its value is set to 0.

[IMP] web: clean code
@kitan191 kitan191 force-pushed the master-timesheets-clean-day-duration-pta branch from 74406b6 to cae4ac2 Compare July 23, 2020 11:55
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Jul 23, 2020
@tivisse tivisse changed the title Master timesheets clean day duration pta [MERGE] hr_timesheet: clean durations expressed in hours if encoding unit is in days Aug 3, 2020
@tivisse
Copy link
Contributor

tivisse commented Aug 3, 2020

@robodoo r+ merge

@robodoo robodoo added the r+ 👌 label Aug 3, 2020
@robodoo
Copy link
Contributor

robodoo commented Aug 3, 2020

Merge method set to merge directly, using the PR as merge commit message

@robodoo robodoo closed this Aug 3, 2020
@robodoo robodoo temporarily deployed to merge August 3, 2020 14:09 Inactive
@robodoo robodoo merged commit 30d1222 into odoo:master Aug 3, 2020
@tivisse tivisse deleted the master-timesheets-clean-day-duration-pta branch August 3, 2020 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI 🤖 Robodoo has seen passing statuses RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants