Extended Leave Days Computation

hr_holidays_compute_days
REPOSITORY
REPOSITORYOCA/hr
GIT
GIThttps://github.com/OCA/hr.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/hr/tree/11.0/hr_holidays_compute_days
VERSION
VERSION 1.2.1
CATEGORY
CATEGORYHuman Resources
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), iDT LABS
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), iDT LABS
COMMITTERS
COMMITTERSPedro M. Baeza, GitHub, OCA Transbot, oca-travis, OCA-git-bot, gprina
WEBSITE
WEBSITEhttps://github.com/OCA/hr
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:23:58
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - hr_holidays
    - hr
    - base_setup
    - base
    - web
    - mail
    - bus
    - web_tour
    - resource
    - calendar
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
edit_holiday_new Leave Request - Add full day + hide nº of days + show related readonly hr.holidays field Inherits hr_holidays.edit_holiday_new
edit_holiday_new_manager Leave Request - # of days editable for manager hr.holidays field Inherits edit_holiday_new
edit_holiday_status_form hr.holidays.status.form - Add compute fields hr.holidays.status xpath Inherits hr_holidays.edit_holiday_status_form
Models touched (4)

New fields (0)

No new fields.

Public methods (1)
  • get_day_work_hours_count(self, day_date, calendar=None)
    Return 24 as work hours when detecting through context and weekday that the day passed is one of the rest days.

New fields (4)
  • date_from_full Date
    compute='_compute_date_from_full' inverse='_inverse_date_from_full' readonly=True states={'draft': [('readonly', False)], 'confirm': [('readonly', False)]}
  • date_to_full Date
    compute='_compute_date_to_full' inverse='_inverse_date_to_full' readonly=True states={'draft': [('readonly', False)], 'confirm': [('readonly', False)]}
  • from_full_day Boolean
    copy=False default=<expr> readonly=True states={'draft': [('readonly', False)], 'confirm': [('readonly', False)]}
  • to_full_day Boolean
    copy=False default=<expr> readonly=True states={'draft': [('readonly', False)], 'confirm': [('readonly', False)]}
Public methods (0)

No public methods.

New fields (2)
  • compute_full_days Boolean
    default=True help='If enabled, the number of days computed will be always for the full days in the interval' string='Compute Full Days'
  • exclude_rest_days Boolean
    default=True help="If enabled, the employee's day off is skipped in leave days calculation." string='Exclude Rest Days'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/hr
GIT
GIThttps://github.com/OCA/hr.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/hr/tree/10.0/hr_holidays_compute_days
VERSION
VERSION 3.1.1
CATEGORY
CATEGORYHuman Resources
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), iDT LABS
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), iDT LABS
COMMITTERS
COMMITTERSAlexandre Fayolle, Pedro M. Baeza, GitHub, Andrea, OCA Transbot, oca-travis, OCA-git-bot, rpirard
WEBSITE
WEBSITEhttps://github.com/OCA/hr
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:19:57
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/hr:
    - hr_public_holidays
odoo/odoo:
    - hr_holidays
    - hr
    - base_setup
    - base
    - web_kanban
    - web
    - mail
    - bus
    - web_tour
    - resource
    - calendar
    - base_action_rule
    - web_calendar
    - product
    - decimal_precision
    - report
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
edit_holiday_new Leave Request - Add full day + hide nº of days + show related readonly hr.holidays field Inherits hr_holidays.edit_holiday_new
edit_holiday_new_manager Leave Request - # of days editable for manager hr.holidays field Inherits edit_holiday_new
edit_holiday_status_form hr.holidays.status.form - Add compute fields hr.holidays.status xpath Inherits hr_holidays.edit_holiday_status_form
Models touched (4)

New fields (0)

No new fields.

Public methods (1)
  • get_work_days_count(self, from_datetime, to_datetime, calendar=None)
    Get the number or fraction of days that corresponds to this employee according its working time, leaves and public holidays.

New fields (5)
  • date_from_full Date
    compute='_compute_date_from_full' inverse='_inverse_date_from_full' readonly=True states={'draft': [('readonly', False)], 'confirm': [('readonly', False)]}
  • date_to_full Date
    compute='_compute_date_to_full' inverse='_inverse_date_to_full' readonly=True states={'draft': [('readonly', False)], 'confirm': [('readonly', False)]}
  • from_full_day Boolean
    copy=False default=<expr> readonly=True states={'draft': [('readonly', False)], 'confirm': [('readonly', False)]}
  • number_of_days_temp_related Float
    readonly=True related='number_of_days_temp'
  • to_full_day Boolean
    copy=False default=<expr> readonly=True states={'draft': [('readonly', False)], 'confirm': [('readonly', False)]}
Public methods (0)

No public methods.

New fields (3)
  • compute_full_days Boolean
    default=True help='If enabled, the number of days computed will be always for the full days in the interval' string='Compute Full Days'
  • exclude_public_holidays Boolean
    default=True help='If enabled, public holidays are skipped in leave days calculation.' string='Exclude Public Holidays'
  • exclude_rest_days Boolean
    default=True help="If enabled, the employee's day off is skipped in leave days calculation." string='Exclude Rest Days'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/hr
GIT
GIThttps://github.com/OCA/hr.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/hr/tree/9.0/hr_holidays_compute_days
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYHuman Resources
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Camptocamp SA, iDT LABS
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Camptocamp SA, iDT LABS
COMMITTERS
COMMITTERSPedro M. Baeza, GitHub, Stéphane Bidoul (ACSONE), OCA Transbot, Damien Crier, oca-travis, Stephan Rozendaal
WEBSITE
WEBSITEhttp://idtlabs.sl
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:15:21
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/hr:
    - hr_public_holidays
odoo/odoo:
    - hr
    - base_setup
    - base
    - web_kanban
    - web
    - mail
    - bus
    - resource
    - web_tip
    - hr_contract
    - base_action_rule
    - hr_holidays
    - calendar
    - web_calendar
    - report
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
edit_holiday_new Leave Request (hr_holidays_working_time) hr.holidays field Inherits hr_holidays.edit_holiday_new
edit_holiday_status_form hr.holidays.status.form hr.holidays.status data Inherits hr_holidays.edit_holiday_status_form
Models touched (3)

New fields (0)

No new fields.

Public methods (1)
  • work_scheduled_on_day(self, date_dt, public_holiday=True, schedule=True)
    @api.multi
    ' returns true or false depending on if employee was scheduled to work on a particular day. It does this by both checking if it is a public holiday and the resource calendar of the contract @param date_dt: date for which to check @param public_holiday: optional, whether to consider public holidays, default=True @param schedule: optional, whether to consider the contract's resource calendar. default=True

New fields (0)

No new fields.

Public methods (3)
  • onchange_date_from(self, date_to, date_from)
    @api.multi
  • onchange_date_to(self, date_to, date_from)
    @api.multi
  • onchange_employee(self, employee_id)
    @api.multi

New fields (2)
  • exclude_public_holidays Boolean
    help='If enabled, public holidays are skipped in leave days calculation.' args: 'Exclude Public Holidays'
  • exclude_rest_days Boolean
    help="If enabled, the employee's day off is skipped in leave days calculation." args: 'Exclude Rest Days'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/hr
GIT
GIThttps://github.com/OCA/hr.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/hr/tree/8.0/hr_holidays_compute_days
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYHuman Resources
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), iDT LABS
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), iDT LABS
COMMITTERS
COMMITTERSFekete Mihai, Stéphane Bidoul (ACSONE), OCA Transbot, Moises Lopez - https://www.vauxoo.com/, oca-travis
WEBSITE
WEBSITEhttp://idtlabs.sl
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:11:23
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/hr:
    - hr_public_holidays
odoo/odoo:
    - hr
    - base_setup
    - base
    - web_kanban
    - web
    - mail
    - resource
    - board
    - hr_contract
    - base_action_rule
    - hr_holidays
    - calendar
    - web_calendar
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
edit_holiday_new Leave Request (hr_holidays_working_time) hr.holidays field Inherits hr_holidays.edit_holiday_new
edit_holiday_status_form hr.holidays.status.form hr.holidays.status data Inherits hr_holidays.edit_holiday_status_form
Models touched (3)

New fields (0)

No new fields.

Public methods (1)
  • work_scheduled_on_day(self, date_dt, public_holiday=True, schedule=True)
    @api.multi
    ' returns true or false depending on if employee was scheduled to work on a particular day. It does this by both checking if it is a public holiday and the resource calendar of the contract @param date_dt: date for which to check @param public_holiday: optional, whether to consider public holidays, default=True @param schedule: optional, whether to consider the contract's resource calendar. default=True

New fields (0)

No new fields.

Public methods (3)
  • onchange_date_from(self, date_to, date_from)
    @api.multi
  • onchange_date_to(self, date_to, date_from)
    @api.multi
  • onchange_employee(self, employee_id)
    @api.multi

New fields (2)
  • exclude_public_holidays Boolean
    help='If enabled, public holidays are skipped in leave days calculation.' args: 'Exclude Public Holidays'
  • exclude_rest_days Boolean
    help="If enabled, the employee's day off is skipped in leave days calculation." args: 'Exclude Rest Days'
Public methods (0)

No public methods.