Skip to content

[18.0][IMP] sale_timesheet_rounded: add rounded hours on tasks and sale orders#929

Open
thienvh332 wants to merge 1 commit into
OCA:18.0from
thienvh332:18.0-imp-sale_timesheet_rounded
Open

[18.0][IMP] sale_timesheet_rounded: add rounded hours on tasks and sale orders#929
thienvh332 wants to merge 1 commit into
OCA:18.0from
thienvh332:18.0-imp-sale_timesheet_rounded

Conversation

@thienvh332

Copy link
Copy Markdown

Summary

This PR enhances the sale_timesheet_rounded module by exposing rounded timesheet values directly on tasks and sale orders, allowing users to compare actual and rounded hours more clearly across the project and sales flows.

Main Changes

Task rounded-hour metrics

Added new computed fields on project.task:

  • effective_hours_rounded: rounded hours directly logged on the task
  • subtask_effective_hours_rounded: recursive aggregation of rounded hours from child tasks
  • total_hours_spent_rounded: combined rounded hours from the task and its subtasks
  • remaining_hours_rounded: remaining allocated hours based on rounded spent time

Sale order rounded totals

Added a new computed field on sale.order:

  • timesheet_total_duration_rounded: aggregated rounded duration from all related analytic lines

UI Improvements

Task form view

Reworked the time summary section to display side-by-side Actual vs Rounded values for:

  • Time Spent
  • Sub-task Time
  • Total Time
  • Remaining Time

Task kanban view

  • Replaced remaining_hours badge with remaining_hours_rounded

Sale order form

  • Updated the timesheet stat button to display Rounded / Actual instead of actual only

Refactoring

Split sale.py into:

  • sale_order.py
  • sale_order_line.py

to improve readability and separation of concerns.

@OCA-git-bot OCA-git-bot added series:18.0 mod:sale_timesheet_rounded Module sale_timesheet_rounded labels May 22, 2026
@thienvh332 thienvh332 force-pushed the 18.0-imp-sale_timesheet_rounded branch from 23c2ecf to f158cd4 Compare May 22, 2026 04:58

@divad1196 divad1196 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good.
Made a couple of remarks

Comment thread sale_timesheet_rounded/models/project_task.py Outdated
Comment thread sale_timesheet_rounded/models/project_task.py Outdated
- Split sale.py into sale_order_line.py and sale_order.py for clarity
- Add computed fields on project.task: effective_hours_rounded,
  remaining_hours_rounded, total_hours_spent_rounded,
  subtask_effective_hours_rounded
- Add timesheet_total_duration_rounded on sale.order to display
  rounded total beside actual total
- Revamp project_task form view: replace flat hour summary with
  Actual / Rounded two-column table
- Add kanban badge for remaining_hours_rounded
- Add sale_order view showing "Recorded (Rounded / Actual)"
  in the timesheet stat button
@thienvh332 thienvh332 force-pushed the 18.0-imp-sale_timesheet_rounded branch from f158cd4 to e1c0b6d Compare May 22, 2026 09:52

@cgarcia-solvos cgarcia-solvos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code and functional review. LGTM!

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

1 similar comment
@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants