Odoo 20.0 Community · Persistent

hr.leave: fields, relations and API

The hr.leave model ("Time Off") is a persistent model declared by the Time Off module, then extended by 3 other modules. It exposes 96 fields, 65 of them declared directly on the model; 8 fields from other models point to it. Below you will find every field with its technical name, type, label and relations, followed by an Odoo 20 JSON-2 API call.

Model identity

Technical name
hr.leave
Label
Time Off
Type
Persistent (models.Model)
SQL table
hr_leave
Origin module
Time Off (hr_holidays)
Extended by
hr_holidays_attendance, l10n_fr_hr_holidays, project_timesheet_holidays
Default order (_order)
date_from desc
Inherits from (mixins)
mail.thread.main.attachmentmail.activity.mixinhr.leave.display.name.mixinhr.time.rule.source.mixin

Model fields

65 own fields, 25 inherited from mixins and 6 automatic ORM fields. Click a name to get a direct link to that field.

96 of 96 fields shown

Technical nameLabelTypeDetails
active_employeeEmployee Activeboolean

related: employee_id.active

allocation_display_warningAllocation Display Warningchar
computed
allowed_request_durationsAllowed Request Durationsjson
computed
allowed_work_entry_type_idsAllowed Work Entry Typemany2many
computed
attachment_idsAttachmentsone2many

inverse: res_id

attachment_is_visibleAttachment Is Visibleboolean
computed
can_approveCan Approveboolean
computed
can_back_to_approveCan Back To Approveboolean
computed
can_cancelCan Cancelboolean
computed
can_refuseCan Refuseboolean
computed
can_rescheduleCan Rescheduleboolean
computed
can_validateCan Validateboolean
computed
colorColorinteger

related: work_entry_type_id.color

company_idCompanymany2one
computed, stored
count_asCount Asselection

related: work_entry_type_id.count_as

dashboard_warning_messageDashboard Warning Messagechar
computed
date_fromStart Datedatetime
computed, stored
date_toEnd Datedatetime
computed, stored
department_idDepartmentmany2one
computed, stored
duration_displayRequestedchar
computed
employee_company_idEmployee Companymany2one

related: employee_id.company_id

employee_idEmployeemany2one
required
first_approver_idFirst Approval

This area is automatically filled by the user who validate the time off

many2one
read-only
has_mandatory_dayHas Mandatory Dayboolean
computed
is_hatchedHatchedboolean
computed
is_strikedStrikedboolean
computed
is_time_rule_trimmedTrimmed by Time Rule

Set when a time rule trims this leave's end to sub-day precision. Prevents _compute_date_from_to from snapping the end back to the schedule boundary.

boolean
l10n_fr_date_to_changedL10N Fr Date To Changedboolean

added by France - Time Off (l10n_fr_hr_holidays)

last_several_daysAll dayboolean
computed
max_leavesMax Leavesfloat
computed
meeting_idMeetingmany2one
nameDescriptionchar
computed
notesReasonstext
number_of_daysDuration (Days)

Number of days of the time off request. Used in the calculation.

float
computed, stored
number_of_hoursDuration (Hours)

Number of hours of the time off request. Used in the calculation.

float
computed, stored
output_leave_idsOutput Leaveone2many

inverse: source_leave_id

private_nameTime Off Descriptionchar
request_date_fromRequest Start Datedate
request_date_from_periodDate Period Startselection

Values: am (Morning), pm (Afternoon)

request_date_hour_fromRequest Date Hour Fromdatetime
computed
request_date_hour_toRequest Date Hour Todatetime
computed
request_date_toRequest End Datedate
request_date_to_periodDate Period Endselection

Values: am (Morning), pm (Afternoon)

request_durationDurationselection

Values: full (Full Day), am (Morning), pm (Afternoon), specific (Specific)

request_hour_fromHour fromfloat
request_hour_toHour tofloat
resource_calendar_idResource Calendarmany2one
computed, stored
second_approver_idSecond Approval

This area is automatically filled by the user who validate the time off with second level (If time type need second validation)

many2one
read-only
source_leave_idSource Leavemany2one
stateStatusselection

Values: confirm (To Approve), refuse (Refused), validate1 (Second Approval), validate (Approved), cancel (Cancelled)

supported_attachment_idsAttach Filemany2many
computed
supported_attachment_ids_countSupported Attachment Ids Countinteger
computed
time_rule_idTime Rulemany2one
time_rule_time_rangeTime Rule Time Range

HH:MM → HH:MM label shown on rule-split and trimmed leaves.

char
computed
timesheet_idsAnalytic Linesone2many

inverse: holiday_id

added by Timesheet when on Time Off (project_timesheet_holidays)

tzTzselection
computed

Values computed at runtime

tz_mismatchTz Mismatchboolean
computed
user_idUsermany2one
read-only

related: employee_id.user_id

validation_typeValidation Typeselection

related: work_entry_type_id.leave_validation_type

virtual_remaining_leavesAvailable Time Offfloat
computed
work_entry_type_idTime Typemany2one
required
work_entry_type_increases_durationWork Entry Type Increases Durationchar
computed
work_entry_type_request_unitWork Entry Type Request Unitselection
read-only

related: work_entry_type_id.request_unit

work_entry_type_requires_allocationWork Entry Type Requires Allocationboolean

related: work_entry_type_id.requires_allocation

work_entry_type_support_documentWork Entry Type Support Documentboolean

related: work_entry_type_id.support_document

activity_calendar_event_idNext Activity Calendar Eventmany2one
computed

inherited from mail.activity.mixin

activity_date_deadlineNext Activity Deadlinedate
read-onlycomputed

inherited from mail.activity.mixin

activity_exception_decorationActivity Exception Decoration

Type of the exception activity on record.

selection
computed

Values: warning (Alert), danger (Error)

inherited from mail.activity.mixin

activity_exception_iconIcon

Icon to indicate an exception activity.

char
computed

inherited from mail.activity.mixin

activity_idsActivitiesone2many

inverse: res_id

inherited from mail.activity.mixin

activity_plans_idsActivity Plansmany2many
computed

inherited from mail.activity.mixin

activity_stateActivity State

Status based on activities Overdue: Due date is already passed Today: Activity date is today Planned: Future activities.

selection
computed

Values: overdue (Overdue), today (Today), planned (Planned)

inherited from mail.activity.mixin

activity_summaryNext Activity Summarychar

related: activity_ids.summary

inherited from mail.activity.mixin

activity_type_iconActivity Type Iconchar

related: activity_ids.icon

inherited from mail.activity.mixin

activity_type_idNext Activity Typemany2one

related: activity_ids.activity_type_id

inherited from mail.activity.mixin

activity_user_idResponsible Usermany2one
read-onlycomputed

inherited from mail.activity.mixin

has_messageHas Messageboolean
computed

inherited from mail.thread

message_attachment_countAttachment Countinteger
computed

inherited from mail.thread

message_follower_idsFollowersone2many

inverse: res_id

inherited from mail.thread

message_has_errorMessage Delivery error

If checked, some messages have a delivery error.

boolean
computed

inherited from mail.thread

message_has_error_counterNumber of errors

Number of messages with delivery error

integer
computed

inherited from mail.thread

message_has_sms_errorSMS Delivery error

If checked, some messages have a delivery error.

boolean
computed

inherited from mail.thread

message_idsMessagesone2many

inverse: res_id

inherited from mail.thread

message_is_followerIs Followerboolean
computed

inherited from mail.thread

message_main_attachment_idMain Attachmentmany2one

inherited from mail.thread.main.attachment

message_needactionAction Needed

If checked, new messages require your attention.

boolean
computed

inherited from mail.thread

message_needaction_counterNumber of Actions

Number of messages requiring action

integer
computed

inherited from mail.thread

message_partner_idsFollowers (Partners)many2many
computed

inherited from mail.thread

my_activity_date_deadlineMy Activity Deadlinedate
read-onlycomputed

inherited from mail.activity.mixin

rating_idsRatingsone2many

inverse: res_id

inherited from mail.thread

create_dateCreated ondatetime
read-onlyautomatic
create_uidCreated bymany2one
read-onlyautomatic
display_nameDisplay Namechar
read-onlycomputedautomatic
idIDinteger
read-onlyautomatic
write_dateLast Updated ondatetime
read-onlyautomatic
write_uidLast Updated bymany2one
read-onlyautomatic

Relations

Models linked from this model

Fields of other models pointing here

Reading this model through the API

Odoo 20 JSON-2 API call reading the first five records with real fields of the model. Replace the instance, database and API key with your own.

curl
curl -X POST "https://your-instance.odoo.com/json/2/hr.leave/search_read" \
  -H "Authorization: bearer $ODOO_API_KEY" \
  -H "X-Odoo-Database: your-db" \
  -H "Content-Type: application/json" \
  -d '{"domain":[],"fields":["name","employee_id","work_entry_type_id","state","company_id"],"limit":5}'
Python (requests)
import requests

BASE_URL = "https://your-instance.odoo.com/json/2"
headers = {"Authorization": f"bearer {API_KEY}", "X-Odoo-Database": "your-db"}

res = requests.post(
    f"{BASE_URL}/hr.leave/search_read",
    headers=headers,
    json={"domain": [], "fields": ["name","employee_id","work_entry_type_id","state","company_id"], "limit": 5},
)
res.raise_for_status()
print(res.json())
  • External API access requires Odoo's Custom plan.
  • XML-RPC and JSON-RPC will be removed in Odoo 22 (fall 2028): use JSON-2.
  • The access rights and record rules of the key's user apply.

Cite this tool

Writing a tutorial, internal documentation or a forum answer? Copy this link to send your readers to the up-to-date reference.

<a href="https://aidoo.ai/en/outils/explorateur-modeles-odoo/hr-leave">hr.leave (Odoo 20.0)</a>

Sources

Data verified on September 25, 2026 · Odoo 20.0 Community

Have an Odoo project, or want to put your ERP to work with AI? Let's talk

Implementation, custom module development, connecting Claude or ChatGPT to your data: tell us about your context and we will reply within 24 business hours.