[17.0] Timesheet sheet bug in create new timesheet sheet
Module
Timesheet sheet 17.0
Describe the bug
I got issue create new timesheet sheet when other in week is in confirmed stage (waiting review/ approved), example:
- I created timesheet sheet week 42 and submit for reviewer or it is approved
- Timesheet sheet week 40, 41... will not be created after that with an error message " You cannot modify an entry in a confirmed timesheet sheet....."
To Reproduce
Affected versions: Version 17.0
Expected behavior
Additional context
Add any other context about the problem here. (Windows, PyCharm/ Python 3.12)
Got a similar issue. If I create a timesheet sheet for last week, while already having timesheet lines (account.analytic.line) this week, the module tries to delete this week's timesheets.
Searched for a solution but couldn't find one yet.
Hi there, this issue is really annoying. I just spend 2 hours without finding a solution @OCA/human-resources-maintainers can you help us? Thanks in advance
@nghiamon @tristancatteeuw @valentinthirion Hi, This error from module OCA or standard odoo?
if it error from standard odoo. i suggest you open issue here https://github.com/odoo/odoo/issues
@Saran440 Hi, there error comes from OCA module for us. We ended up finding a fix four our Odoo at least, by replacing those lines : https://github.com/OCA/timesheet/blob/14.0/hr_timesheet_sheet/models/hr_timesheet_sheet.py#L425-L435
to this :
@api.depends('date_start', 'date_end', 'employee_id') def _compute_timesheet_ids(self): sheet.timesheet_ids = AccountAnalyticLines.search(sheet._get_timesheet_sheet_lines_domain())
There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.