OdooWiki OCA HUB

Resource Hook

resource_hook folder_open OCA/hr open_in_new
Uncategorised License: AGPL-3

This module includes additional hooks to the standard resource methods, so that it is possible to alter the behaviour of methods, where inheritance is not an option.

auto_awesome What this module does

AI-generated from the code · Odoo 14.0

Adds extension points (hooks) to the standard working-time calculation methods of resource calendars and resources, so other modules can change how worked hours are computed without rewriting Odoo's core code.

This is a technical foundation module. It does not add any new screen, menu, button or report. What it changes is how Odoo calculates working time behind the scenes.

It takes several standard methods used to compute working hours, days worked, planning of hours and leave time on resource calendars and resources, and replaces them with versions that call small, replaceable pieces. Those pieces are the "hooks": one returns the hours between the start and end of a work interval, and another returns the hours of a single attendance line.

Because these pieces are separate, other modules can override just that logic (for example, to count hours differently) without copying the whole calculation. The original methods are kept under a backup name so they remain available.

The affected areas are the resource calendar and the resource mixin, which are the base for working schedules used by employees, work centres and planning. The calculations covered include worked days and hours, total hours per resource per day, counting work hours between two dates, planning a number of hours from a date, average hours per day, listing work time per day and listing leave time.

No data is stored and no user-facing behaviour changes by itself; the effect only appears when another module uses these hooks.

Depends on

resource

Required by other modules

Models and fields (2)
  • resource.mixin · extends an existing model
  • resource.calendar · extends an existing model

Text generated by AI (DeepSeek) from reading the Odoo 14.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: 3 confirmed, 6 with no information of 9 versions.

terminal Installation and usage

No verified information

Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.

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.