[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
1. Generic timesheets improvements
- Portal /my/timesheets
- Add a group bys task, date, employee
- Add search in project, name, employee, task
* The task column should not be visible if none of the timesheets have the Task field set
- If a group by task, date, employee or project is applied, the corresponding column should not be visible
2. Timesheets from sub-tasks on parent tasks
- Portal /my/tasks
- Display the 'Total Hours' spent on a task at the end of the list of timesheets
- Below the list of timesheets for the task, display another table detailing the respective timesheets (and total hours) of each sub-task linked to this task (= 1 table/list per sub-task)
* Title should be: 'Timesheets for sub-task: xyz'
* only visible if there are sub-tasks linked to this task
* only visible if total hours > 0
3. Timesheets on Invoices
- Portal /my/invoices
- Add Project + task fields
* Task field only visible if set on one of the timesheet entries
* Project field only visible if there are at least 2 different projects in these timesheet entries
4. Correct visibility for the portal users
- Portal users is allowed to see timesheets if the users are added in allowed portal users list in the project
- When a portal user is added as the message follower of the project, the user is added to allowed portal users as well
- When a portal user is removed from allowed portal users, the user is also removed from message followers
closesodoo/odoo#47248
Taskid: 2201908
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Purpose of the commit is to add a timesheet section on portal
where you can see all the timesheets and user can see and use the filter
options on them (available when only hr_timesheet is installed)
task-1932488