Working schedules¶
A working schedule (resource.calendar) describes when work is expected. It is made of
attendances (resource.calendar.attendance), the expected work slots, and leaves
(resource.calendar.leaves), the periods interrupting them. Every resource, hence every
employee, has a calendar; each company has a default one (res.company.resource_calendar_id).
This page explains these three models, then the methods used to compute work intervals, durations and dates from them.
Zobacz także
Intervals and Conventions, which apply to every method described below.
Calendar types¶
The calendar_type field determines how attendances are defined:
fixed(default)Undated attendances repeated every week on their
dayofweek('0'is Monday). This is the regular „Monday to Friday, 8:00-12:00 and 13:00-17:00” schedule.hours_per_week,days_per_weekandhours_per_dayare computed from the attendances.variableDated attendances (
date), optionally recurring:recurrency_type(daysorweeks),recurrency_interval,recurrency_end_type(forever,timesordate) and the list of excluded occurrences. Multi-week rotations (e.g. one week out of two) are variable calendars with recurring attendances.hours_per_weekandhours_per_dayare set manually.undefined(flexible)No attendance at all: the resource works whenever it wants, optionally within an
hours_per_weekand anhours_per_daytarget. When both targets are zero, the calendar is fully flexible and the resource is considered as working the whole time. See Flexible calendars.
Switching the type of a calendar deletes the attendances that do not fit the new type.
Attendances¶
An attendance is either:
timed:
hour_fromandhour_toare set, as float hours in the local time of the resource (16.5is 16:30,24is the end of the day);duration-based: only
duration_hoursis set (e.g. 8 hours on Monday). When intervals are generated, the duration-based attendances of a day are placed one after the other, centered on 12:00. The default calendar of a company is built this way, so its intervals are 8:00-16:00.
A day cannot mix both kinds. day_period (morning, afternoon or full_day) is computed
from the hours; it is used to request half days of time off.
Leaves¶
A resource.calendar.leaves record is a period during which the calendar’s attendances do not
apply:
without
resource_id, it is a global leave (typically a public holiday): it applies to every resource of its company using the calendar;with a
resource_id, it only applies to that resource. Validated time off requests create such leaves.
count_as tells whether the leave is an absence (default) or counts as working_time (e.g. a
training). Leave methods only deduct absences by default.
date_from and date_to are datetime fields, hence naive UTC datetimes in the database.
Computing work intervals¶
Four methods generate the intervals of a calendar for a period, in batch for several resources. They all follow the conventions of the module.
_attendance_intervals_batch()The theoretical work intervals generated by the attendances, leaves not deducted. Each interval carries its attendance as payload.
_leave_intervals_batch()The leave intervals: global leaves, plus the leaves of each resource. Each interval carries its leaves as payload.
_work_intervals_batch()The effective work intervals: attendance intervals minus leave intervals. This is the method to use to know when resources actually work, and the one other modules override to alter the result (e.g.
hr_work_entry)._unavailable_intervals_batch()The complement of the work intervals within the period, in UTC. Used by Gantt views to grey out unavailable time.
_leave_intervals and _unavailable_intervals are single-resource shortcuts.
Example
A 38-hour calendar (8:00-12:00 and 13:00-16:36, Monday to Friday) with a public holiday on
Tuesday, and two resources in different timezones, r2 being sick on Wednesday morning.
from datetime import datetime
from zoneinfo import ZoneInfo
from odoo.fields import Command
calendar = env['resource.calendar'].create({
'name': 'Standard 38 hours/week',
'attendance_ids': [Command.clear()] + [
Command.create({'dayofweek': str(day), 'hour_from': hour_from, 'hour_to': hour_to})
for day in range(5)
for hour_from, hour_to in ((8, 12), (13, 16.6))
],
})
r1 = env['resource.resource'].create({
'name': 'R1', 'calendar_id': calendar.id, 'tz': 'Asia/Kolkata',
})
r2 = env['resource.resource'].create({
'name': 'R2', 'calendar_id': calendar.id, 'tz': 'Europe/Brussels',
})
env['resource.calendar.leaves'].create([{
'name': 'Public holiday', # global leave: no resource
'calendar_id': calendar.id,
'date_from': datetime(2026, 10, 20, 0, 0), # naive UTC
'date_to': datetime(2026, 10, 20, 22, 0),
}, {
'name': 'Sick',
'resource_id': r2.id,
'date_from': datetime(2026, 10, 21, 6, 0),
'date_to': datetime(2026, 10, 21, 10, 0),
}])
brussels = ZoneInfo('Europe/Brussels')
start = datetime(2026, 10, 19, tzinfo=brussels)
end = datetime(2026, 10, 24, tzinfo=brussels)
resources_per_tz = (r1 | r2)._get_resources_per_tz()
attendances = calendar._attendance_intervals_batch(start, end, resources_per_tz)
list(attendances) # [r1.id, False, r2.id]
next(iter(attendances[r2.id]))
# (datetime(2026, 10, 19, 8, 0, tzinfo=ZoneInfo('Europe/Brussels')),
# datetime(2026, 10, 19, 12, 0, tzinfo=ZoneInfo('Europe/Brussels')),
# resource.calendar.attendance(...))
next(iter(attendances[r1.id]))[0]
# datetime(2026, 10, 19, 8, 0, tzinfo=ZoneInfo('Asia/Kolkata')): 8:00 local time
work = calendar._work_intervals_batch(start, end, resources_per_tz)
{
key: sum((stop - start).total_seconds() / 3600 for start, stop, _ in intervals)
for key, intervals in work.items()
}
# {r1.id: 30.4, False: 30.4, r2.id: 26.4}
Computing durations¶
When only a quantity of work is needed, use:
get_work_hours_count()The number of calendar-level work hours between two dates or datetimes. Only global leaves are deducted (no resource).
get_work_duration_data()The calendar-level work duration as
{'days': float, 'hours': float}._get_attendance_intervals_days_data()Converts any work intervals into
{'days': float, 'hours': float}. A day counts for half a day if its hours are at most 3/4 of the reference hours of that day, otherwise for a full day.
For a specific resource or employee, use the methods of resource.mixin instead, which also deduct the leaves of the resource.
Example
With the calendar of the previous example:
calendar.get_work_hours_count(start, end) # 30.4
calendar.get_work_hours_count(start, end, compute_leaves=False) # 38.0
calendar.get_work_duration_data(start, end) # {'days': 4.0, 'hours': 30.4}
Ważne
With timezone-aware datetimes, get_work_hours_count reads the attendance hours in the
timezone of the given datetimes. Passing UTC datetimes to compute the hours of a Brussels
calendar reads 8:00-12:00 as 8:00-12:00 UTC. Pass datetimes in the right timezone, or dates
(interpreted in the company’s timezone).
Planning and dates¶
plan_hours()Returns the datetime at which a given number of work hours, starting from a datetime, ends (or starts, with a negative number of hours). The computation happens in the timezone of the given
resource, or of the company without resource.plan_days()Same, with a number of working days. It returns the end of the first attendance of the last day (e.g. 12:00 for a schedule with a lunch break), not the end of that day.
_get_closest_work_time()Returns the work interval start (or end) closest to a datetime, e.g. to snap a datetime typed by a user to the working hours.
_works_on_date()and_get_attendances_by_date()Tell whether the calendar has attendances on a date, and which ones, taking recurrences of variable calendars into account.
_get_unusual_days()Returns
{'YYYY-MM-DD': bool},Truefor days without work (weekends, public holidays). Calendar widgets use it to grey out days.
Example
monday_9am = datetime(2026, 10, 19, 9, 0, tzinfo=brussels)
calendar.plan_hours(10, monday_9am, resource=r2)
# datetime(2026, 10, 20, 11, 24, tzinfo=ZoneInfo('Europe/Brussels'))
# with compute_leaves, the public holiday and the sick leave of r2 are skipped
calendar.plan_hours(10, monday_9am, compute_leaves=True, resource=r2)
# datetime(2026, 10, 21, 16, 24, tzinfo=ZoneInfo('Europe/Brussels'))
calendar.plan_hours(2, datetime(2026, 10, 19, 9, 0), resource=r2) # naive = UTC
# datetime(2026, 10, 19, 12, 0): 11:00 to 14:00 in Brussels, lunch break excluded
calendar._get_unusual_days(start, end)
# {'2026-10-19': False, '2026-10-20': True, '2026-10-21': False, '2026-10-22': False,
# '2026-10-23': False, '2026-10-24': True}
Flexible calendars¶
A flexible calendar (calendar_type = 'undefined', see
_is_flexible()) has no
attendance, so the interval methods generate synthetic ones for the resources using it:
fully flexible (no hours target): a single interval covering the whole period;
with targets: one interval per day, of at most
hours_per_dayhours centered on 12:00, untilhours_per_weekis reached. Weeks are counted in blocks of 7 days starting atstart_dt, not in calendar weeks.
Leaves of a flexible resource are extended to whole days.
Informacja
Whether a resource is flexible is decided from its own calendar at the start of the period
(or the calendar of its employee’s version, with hr), not from the calendar the method is
called on.
Example
flexible = env['resource.calendar'].create({
'name': 'Flexible 20 hours/week',
'calendar_type': 'undefined',
'hours_per_week': 20,
'hours_per_day': 6,
})
flexible.get_work_duration_data(
datetime(2026, 10, 19, tzinfo=brussels), datetime(2026, 10, 26, tzinfo=brussels),
)
# {'days': 3.5, 'hours': 20.0}: 6 hours from Monday to Wednesday, 2 hours on Thursday
Pitfalls¶
Interval methods raise an assertion error with naive datetimes. Localize them first, e.g.
datetime(2026, 10, 19, tzinfo=ZoneInfo(resource.tz)).Calendar-level results (the
Falsekey,get_work_hours_count, …) only deduct global leaves. Use a resource to also take its own time off into account.domain=Noneanddomain=[]differ in leave methods: the first one only deducts absences, the second one also deducts leaves counted as working time. Domains must be lists.In
get_work_duration_data,domainfilters the leaves whencompute_leavesis set, and the attendances otherwise.The payload of the intervals of a flexible calendar is a new, unsaved attendance holding only
duration_hours: do not rely on itsidorcalendar_id.Do not mutate the returned
Intervals: the same object can be shared by several resources.
Extending¶
The following methods are designed to be overridden:
_work_intervals_batch()to alter the effective work intervals;_get_reference_hours_per_day()to change the number of hours making a full day when converting hours to days;_handle_flexible_leave_interval()to change how the leaves of flexible resources are stretched;resource.calendar.attendance._is_work_periodto exclude some attendances from the work time (hr_work_entryexcludes the attendances whose work entry type counts as an absence).
Reference¶
Original definition from resource¶
- model odoo.addons.resource.models.resource_calendar.ResourceCalendar[źródło]¶
- _name = resource.calendar¶
Working schedule („Working Time”) of resources. It holds:
attendance_ids: theresource.calendar.attendancelines defining when work is expected (per weekday forfixedcalendars, per date, optionally recurring, forvariableones, none forundefined/ flexible ones);leave_ids: theresource.calendar.leaveslinked to this calendar. A leave withoutresource_idis global (public holiday for every resource of the calendar), otherwise it only applies to that resource.
The computation API works on
Intervalsof(start, stop, records)triples, wherestart/stopare timezone-aware datetimes andrecordsis the attendance or leave recordset that produced the interval. Batch methods return a dict{resource_id: Intervals}in which the keyFalseholds the calendar-level result (no specific resource).- calendar_type: str¶
- Required
- Name
Calendar Type
- Selection
fixed: Fixedvariable: Variableundefined: Undefined- Default
fixed
- Fixed: a weekly attendance pattern that repeats identically every week.
Variable: attendances set on specific dates rather than a repeating weekly pattern, such as a one-off schedule or a multi-week rotation.
Undefined: no predefined slots at all. The resource can work whenever it wants, optionally up to an hours target.
- attendance_ids: Sequence[odoo.orm.commands.Command]¶
- Name
Working Time
- Comodel
- leave_ids: Sequence[odoo.orm.commands.Command]¶
- Name
Time Off
- Comodel
- global_leave_ids: Sequence[odoo.orm.commands.Command]¶
- Name
Global Time Off
- Comodel
- hours_per_day: float¶
- Name
Average Hour per Day
Average hours per day a resource is supposed to work with this calendar.
- full_time_required_hours: float¶
- Name
Full Time Equivalent
Number of hours to work on the company schedule to be considered as fulltime.
- _attendance_intervals_batch(start_dt, end_dt, resources_per_tz=None, domain=None)[źródło]¶
Return the theoretical work intervals generated by the attendance lines of this calendar between
start_dtandend_dt, leaves NOT deducted.Each interval is clipped to
[start_dt, end_dt], expressed in the timezone of the resource (attendance hours are local times) and carries its single attendance record as payload (keep_distinct=True: two adjacent attendances stay two intervals). Duration-based attendances (nohour_from/hour_to) are placed contiguously, centered on 12:00.Flexible resources get synthetic intervals instead, based on the calendar returned by
resource._get_calendar_data_at(the resource’s own calendar, or the employee’s version calendar withhr), not onself:fully flexible: a single interval covering the whole period;
flexible with hours targets: one interval per day of at most
hours_per_day, centered on 12:00, untilhours_per_weekis reached in each 7-day block counted fromstart_dt(not calendar weeks).
Their payload is a new (unsaved) attendance holding only
duration_hours.selfholds at most one calendar. It may be empty whenresources_per_tzis given, but then only flexible resources get intervals.- Parametry
start_dt (datetime) – timezone-aware start of the period
end_dt (datetime) – timezone-aware end of the period
resources_per_tz (dict) –
{ZoneInfo: resource.resource recordset}, as returned byresources._get_resources_per_tz(). Defaults to no resource, in the timezone ofstart_dt.domain – optional domain on
resource.calendar.attendancerestricting the attendances used. When given, the flexible handling above is skipped.
- Zwraca
{resource_id: Intervals}for every resource ofresources_per_tz, plus the keyFalse(calendar-level, no resource) whenselfis set. With several timezones, theFalseentry is expressed in the last timezone ofresources_per_tz.- Typ zwracany
- _leave_intervals_batch(start_dt, end_dt, resources_per_tz=None, domain=None)[źródło]¶
Return the leave intervals (
resource.calendar.leaves) overlapping the period, clipped to[start_dt, end_dt]and expressed in the timezone of each resource.A resource gets its own leaves plus the global leaves (no
resource_id) of its company; the calendar-level entry (keyFalse) only gets global leaves. Whenselfis set, only leaves of this calendar or without calendar are considered. Leaves of flexible resources go through_handle_flexible_leave_interval()(whole days by default). Overlapping leaves are merged, the payload being the union of the leave records.- Parametry
start_dt (datetime) – timezone-aware start of the period
end_dt (datetime) – timezone-aware end of the period
resources_per_tz (dict) –
{ZoneInfo: resource.resource recordset}, see_attendance_intervals_batch()domain (list) – domain (as a list) on
resource.calendar.leaves.Nonemeans[('count_as', '=', 'absence')]; any other value, even[], replaces that default, so leaves counted as working time are then included.
- Zwraca
{resource_id: Intervals}for every resource ofresources_per_tz, plus the keyFalsewhenselfis set orresources_per_tzis empty- Typ zwracany
- _work_intervals_batch(start_dt, end_dt, resources_per_tz=None, domain=None, compute_leaves=True)[źródło]¶
Return the effective work intervals: attendance intervals minus leave intervals. This is the method to use (and the one to override, as
hr_work_entrydoes) to know when resources actually work.- Parametry
start_dt (datetime) – timezone-aware start of the period
end_dt (datetime) – timezone-aware end of the period
resources_per_tz (dict) –
{ZoneInfo: resource.resource recordset}, see_attendance_intervals_batch()domain (list) – leave domain passed to
_leave_intervals_batch()(Nonemeans leaves counted as absence). It does not filter attendances.compute_leaves (bool) – when
False, leaves are not deducted and the result equals_attendance_intervals_batch()
- Zwraca
{resource_id: Intervals}, with the keyFalsefor the calendar-level result whenselfis set orresources_per_tzis empty. Intervals are expressed in each resource’s timezone and carry attendance records.- Typ zwracany
Return the periods during which resources do not work: the complement of
_work_intervals_batch()within[start_dt, end_dt], expressed in UTC (used by Gantt views to grey out unavailable time).For a flexible resource (according to its own calendar), only its leaves are unavailable, and the resource has no key at all when it has no leave (callers treat that absence as „no unavailability”).
- Parametry
start_dt (datetime) – timezone-aware start of the period
end_dt (datetime) – timezone-aware end of the period
resources_per_tz (dict) –
{ZoneInfo: resource.resource recordset}, see_attendance_intervals_batch()domain (list) – leave domain, see
_leave_intervals_batch()
- Zwraca
{resource_id: Intervals}in UTC, with the keyFalsewhenselfis set orresources_per_tzis empty- Typ zwracany
- get_work_hours_count(start_dt, end_dt, compute_leaves=True, domain=None)[źródło]¶
Return the number of calendar-level work hours between two dates or datetimes (no resource: only global leaves are deducted).
Attendance hours are interpreted in the timezone of
start_dtafter conversion: dates and naive datetimes are put in the company timezone, aware datetimes keep their own timezone.- Parametry
start_dt –
date(from 00:00 in the company timezone) ordatetime(naive means UTC)end_dt –
date(until 23:59:59.999999 in the company timezone) ordatetime(naive means UTC)compute_leaves (bool) – deduct global leaves
domain (list) – leave domain,
Nonemeans[('count_as', '=', 'absence')], see_leave_intervals_batch()
- Typ zwracany
- get_work_duration_data(from_datetime, to_datetime, compute_leaves=True, domain=None)[źródło]¶
Return the calendar-level working duration of a period, in days and hours, only based on this calendar (no resource: only global leaves are deducted). Days are computed by
_get_attendance_intervals_days_data().Attendance hours are interpreted in the timezone of
from_datetime(UTC if naive).- Parametry
from_datetime (datetime) – start of the period, naive means UTC
to_datetime (datetime) – end of the period, naive means UTC
compute_leaves (bool) – deduct global leaves
domain (list) – with
compute_leaves, the leave domain (Nonemeans[('count_as', '=', 'absence')]); without it, a domain onresource.calendar.attendancefiltering the attendances
- Zwraca
{'days': float, 'hours': float}- Typ zwracany
- _get_attendance_intervals_days_data(attendance_intervals)[źródło]¶
Convert work intervals (typically the output of
_work_intervals_batch()for one resource) into a duration in days and hours.Intervals are split per calendar day (in their own timezone). For each day:
if this calendar has duration-based attendances on that day, the day counts for
hours / sum(their duration_hours)(proportional);otherwise it counts for 0.5 day if its hours are at most 3/4 of
_get_reference_hours_per_day(), else for 1 day.
The payload of the intervals is ignored.
selfmay be empty: then any day with hours counts as 1.- Parametry
attendance_intervals – iterable of
(start, stop, records)with timezone-aware datetimes, e.g. anIntervals- Zwraca
{'days': float, 'hours': float}, days rounded to 0.001- Typ zwracany
- _get_reference_hours_per_day(day)[źródło]¶
Return the number of hours
dayis theoretically made of, used as the full-day reference by_get_attendance_intervals_days_data(). Defaults to the calendar’s averagehours_per_day; overridden byhr_work_entryto include attendances counted as absence.- Parametry
day (date) – the day to evaluate
- Typ zwracany
- plan_hours(hours, day_dt, compute_leaves=False, domain=None, resource=None)[źródło]¶
Return the datetime reached after working
hourshours fromday_dtaccording to this calendar (going backwards ifhoursis negative). Withhours=0, returnday_dtif it is within work time, else the start of the next work interval.Computation happens in the timezone of
resource(company timezone without resource), by windows of 14 days, for at most 100 windows.- Parametry
hours (float) – number of work hours to plan, negative to plan backwards
day_dt (datetime) – starting point; naive means UTC
compute_leaves (bool) – deduct leaves (those of
resourceand global ones); without it, the calendar-level attendances are used andresourceonly gives the timezonedomain (list) – leave domain, see
_leave_intervals_batch()resource – optional
resource.resourcerecord
- Zwraca
the resulting datetime, in the timezone of
day_dt(naive UTC ifday_dtis naive), orFalseif not found within the search range- Typ zwracany
datetime | bool
- plan_days(days, day_dt, compute_leaves=False, domain=None)[źródło]¶
Return the end of the first work interval of the
days-th work day counted fromday_dt(the day ofday_dtincluded if it has work time afterday_dt), or, for a negativedays, the start of the last work interval of theabs(days)-th work day counted backwards.days=0returnsday_dt.Beware: with several attendances per day (e.g. a lunch break), the result is the end of the morning attendance of the last day, not the end of that day.
Calendar-level only (no resource, only global leaves), computed in the company timezone by windows of 14 days, for at most 100 windows.
- Parametry
days (int) – number of work days to plan, negative to plan backwards
day_dt (datetime) – starting point; naive means UTC
compute_leaves (bool) – deduct global leaves
domain (list) – leave domain, see
_leave_intervals_batch()
- Zwraca
the resulting datetime, in the timezone of
day_dt(naive UTC ifday_dtis naive), orFalseif not found within the search range- Typ zwracany
datetime | bool
- _get_closest_work_time(dt, match_end=False, resource=None, search_range=None, compute_leaves=True)[źródło]¶
Return the work interval boundary closest to
dtwithin the search range: the closest interval start, or the closest interval end whenmatch_endis set.Work intervals come from
_work_intervals_batch()forresource, in the resource timezone. Without resource, the calendar-level intervals are used and the attendance hours are interpreted in UTC.- Parametry
dt (datetime) – timezone-aware reference datetime
match_end (bool) – look for interval ends instead of interval starts
resource –
resource.resourcerecord, orNonesearch_range –
(start, end)timezone-aware datetimes; defaults to the whole day ofdtin the resource timezonecompute_leaves (bool) – deduct leaves from the work intervals
- Zwraca
the closest boundary (in the resource timezone), or
Noneifdtis outside the search range or there is no work interval in it- Typ zwracany
datetime | None
- Wyrzuca
ValueError – if
dtorsearch_rangeare naive
- _works_on_date(date)[źródło]¶
Return whether this calendar has a work attendance (see
resource.calendar.attendance._is_work_period) ondate. AlwaysTruefor flexible calendars. Leaves are not considered.- Parametry
date (date) – the day to check
- Typ zwracany
- _get_attendances_by_date(date_from, date_to, domain=None)[źródło]¶
Return the attendances of this calendar applying on each day of the period.
Undated attendances (
fixedcalendars) apply on every day matching theirdayofweek.Dated attendances (
variablecalendars) apply on theirdateand, when recurring, on every occurrence of their recurrence rule up torecurrency_until, except excluded occurrences.
- Parametry
date_from (date) – first day of the period (included)
date_to (date) – last day of the period (included)
domain – optional domain on
resource.calendar.attendance
- Zwraca
{date: resource.calendar.attendance recordset}with one key per day of the period, possibly mapped to an empty recordset (adefaultdict)- Typ zwracany
- _get_unusual_days(start_dt, end_dt, company_id=False, resource=None)[źródło]¶
Tell, for each day between
start_dtandend_dt, whether it is an „unusual” day, i.e. a day without work (weekend, public holiday…). Used by calendar and date picker widgets to grey out days.Days are evaluated with the calendar-level work intervals (global leaves deducted), in the timezone of
start_dt. For a flexibleresource, a day is unusual only if the resource has a leave on it. Only leaves counted as absence are considered: a leave counted as working time (e.g. a training) does not make a day unusual.- Parametry
start_dt (datetime) – start of the period; naive means UTC
end_dt (datetime) – end of the period (its day included); naive means UTC
company_id – optional
res.companyrecord restricting the leaves to that company or to no companyresource – optional
resource.resourcerecord, only used for flexible ones
- Zwraca
{'YYYY-MM-DD': bool},Truefor unusual days- Typ zwracany
- _is_flexible()[źródło]¶
Return whether this calendar is flexible, i.e. of type
undefined: it has no attendance lines and the resource may work whenever it wants, optionally up to thehours_per_week/hours_per_daytargets (see_is_fully_flexible()).
- _is_fully_flexible()[źródło]¶
Return whether this calendar is flexible (see
_is_flexible()) and has no hours target either (hours_per_weekandhours_per_dayboth zero). A fully flexible resource is considered working during the whole requested period.
- _handle_flexible_leave_interval(dt0, dt1, leave)[źródło]¶
Hook adapting the bounds of a resource-specific leave of a flexible resource. By default, the leave is extended to whole days: from 00:00 on the day of
dt0to 23:59:59.999999 on the day ofdt1, in their timezone.- Parametry
dt0 (datetime) – leave start, localized in the resource timezone
dt1 (datetime) – leave end, localized in the resource timezone
leave – the
resource.calendar.leavesrecord
- Zwraca
the adapted
(dt0, dt1)- Typ zwracany
Original definition from resource¶
- model odoo.addons.resource.models.resource_calendar_attendance.ResourceCalendarAttendance[źródło]¶
- _name = resource.calendar.attendance¶
- dayofweek: str¶
- Required
- Name
Day of Week
- Selection
0: Monday1: Tuesday2: Wednesday3: Thursday4: Friday5: Saturday6: Sunday
- hour_from: float¶
- Required
- Name
Work from
- Default
0
Start and End time of working. A specific value of 24:00 is interpreted as 23:59:59.999999.
- day_period: str¶
- Name
Day Period
- Readonly
this field is not supposed to/cannot be set manually
- Selection
morning: Morningafternoon: Afternoonfull_day: Full Day
- date: datetime.date¶
- Name
Date
Original definition from resource¶
- model odoo.addons.resource.models.resource_calendar_leaves.ResourceCalendarLeaves[źródło]¶
- _name = resource.calendar.leaves¶
- date_from: datetime.datetime¶
- Required
- Name
Start Date
- date_to: datetime.datetime¶
- Required
- Name
End Date
- resource_id: int¶
- Name
Resource
- Comodel
If empty, this is a generic time off for the company. If a resource is set, the time off is only for this resource