OdooWiki OCA HUB

Project Timesheet Holidays - re-enable generated timesheets edition

project_timesheet_holidays_editable folder_open OCA/timesheet open_in_new
Human Resources License: AGPL-3

By default, every timesheet generated from a leave becomes read-only, so nobody can directly edit it and e.g. change its hour count. This shouldn't occur in Odoo previous versions.

This could be annoying, because for certain leaves (like medical leaves), final spent time should be different than initial leave filled. This forces to reject, modify and then approve again leave. Exact time could not be filled sometimes anyway, due to leave form hour selection.

This addon re-enables timesheet edition when they're generated from leaves (initially name and quant fields), letting us make it editable depending on leave type.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

Lets you choose, per leave type, who may edit the timesheets automatically created from approved leaves, so hours and descriptions can be corrected without rejecting the leave.

When a leave is approved, Odoo normally creates a timesheet line that is locked. This module adds a setting on each leave type that decides who can still change those generated timesheets.

  • On the leave type form (Time Off > Configuration > Leave Types), a new radio-button field appears next to the timesheet project/task settings. It is only shown when the leave type is set to generate timesheets, and offers three choices: None (nobody can edit), Officer (only users with the Time Off officer rights can edit), and All (any user can edit).
  • The setting is stored on the leave type and defaults to None, so existing behaviour is unchanged until you change it.
  • If the leave type is not configured to generate timesheets, the setting is automatically forced back to None.
  • When someone tries to change a timesheet that came from a leave, the system checks the leave type's setting and the user's rights. If editing is allowed, only the description and the quantity of hours can be changed; other fields remain protected.
  • This applies to timesheet lines (account.analytic.line) linked to a leave (holiday_id), and the option is defined on hr.leave.type.

Depends on

project_timesheet_holidays
Models and fields (2)
  • hr.leave.type · extends an existing modeltimesheet_edit_level
  • account.analytic.line · extends an existing model

Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 2 confirmed, 7 with no information of 9 versions.

Sources · Odoo 17.0

Confirmed on 2026-11-03 in branch 17.0 of OCA/timesheet.

terminal Installation and usage

OCA documentation · Odoo 18.0

Once installed, it adds a configuration option to define the editability level of timesheets generated from each Time Off Type.

Configuration

After installing the module, follow these steps:

  • Go to Time Off (hr_holidays)
  • Navigate to Configuration → Time Off Types
  • Select the desired Time Off Type
  • Make sure the option “Generate Timesheets” (timesheet_generate) is enabled (This configuration menu is only visible if timesheet generation is enabled).
  • Configure the Timesheet Restriction Level

Timesheet Restriction Levels

Each Time Off Type can define how restrictive the generated timesheets are:

  • None
  • The generated timesheet entries cannot be edited by anyone
  • Officer
  • Timesheet entries can only be edited by users belonging to the group: hr_holidays.group_hr_holidays_user
  • Prevents regular employees from modifying generated timesheets
  • All
  • Timesheet entries can be edited by any user with access to timesheets

No verified information in OCA: Installation, Configuration.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.