timesheet icon indicating copy to clipboard operation
timesheet copied to clipboard

[17.0] Timesheet sheet bug in create new timesheet sheet

Open nghiamon opened this issue 1 year ago • 4 comments

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 Week 40 Week 42

Add any other context about the problem here. (Windows, PyCharm/ Python 3.12)

nghiamon avatar Oct 19 '24 16:10 nghiamon

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.

image

tristancatteeuw avatar Nov 20 '24 11:11 tristancatteeuw

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

valentinthirion avatar Nov 28 '24 15:11 valentinthirion

@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 avatar Mar 07 '25 09:03 Saran440

@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())

tristancatteeuw avatar Mar 07 '25 10:03 tristancatteeuw

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.

github-actions[bot] avatar Sep 07 '25 12:09 github-actions[bot]