Skip to content

[16.0] project_timesheet_time_control: Timesheet line not reassigned to sheet when changing date into valid range #1573

@CristianoMafraJunior

Description

@CristianoMafraJunior

Module

project_timesheet_time_control

Describe the bug

When creating a timesheet line on a date outside of the current weekly sheet range, the line is not linked to any hr.timesheet.sheet.

If you later change the date of that line to fall inside the valid sheet range, the sheet_id is not recomputed correctly. As a result, the totals of the sheet are not updated.

To Reproduce

Affected versions:

Create a weekly sheet for week 39 (2025-09-22 → 2025-09-28).

Add a timesheet line with date 2025-09-29 (outside the range).

Save — the line is not linked to any sheet.

Change the date of the same line to 2025-09-28 (inside the range).

Observe that the line still has no sheet_id, and the totals of the sheet remain unchanged.

Expected behavior
When the date (or employee/company) of a line changes, the system should recompute sheet_id and link the line to the correct sheet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions