TIP: You can type at any time to perform a new search.
Resource
resource · odoo/odoo
- Repository
- odoo/odoo · module folder
- Module version
- 1.1
- Category
- Hidden
- Folder size
- 2.37 MB
- License
- LGPL-3
- Application
- No
- Auto-installable
- No
- Website
- None
- Last tracking update
- 2026-08-15 22:44:15
- Authors
- Odoo S.A.
- Maintainers
- Odoo S.A.
- Committers
- Xavier Morel, Raphael Collet, Thibault Delavallée, Odoo Translation Bot, Aaron Bohy, Yannick Tivisse, Jorge Pinna Puissant, Julien Castiaux, Tiffany Chang (tic), Gorash, Mathieu Duckerts-Antoine, Ahmad Khanalizadeh, Loan (LSE), Victor Piryns (pivi), Dylan Kiss (dyki), Mayurrajsinh Rathod, Simon Goffaux (sigo), Xavier Bol (xbo), Youssef Bashandy, bary, Abderraouf Ghrissi (abgh), Julien Carion (juca), Tanguy Quéguineur, Mathieu Coutant, Abdelrahman Mahmoud (amah), st-yes, Chris Duvivier, Corentin Heinix (cohe), Krzysztof Magusiak (krma), Guillaume V, Maeva De Keyser (MDEK), Harrison Hutton, nsirjacobs, akha, kareem, Bertrand Dossogne, romc-odoo, saurabh, Jurgen Gjini, Farah (ahmfa), Amr Yasser (amry)
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- base_automation, crm, digest, fieldservice, hr_holidays, l10n_br_resource, mrp, partner_delivery_zone_calendar, point_of_sale, project, resource_booking, resource_mail, stock_warehouse_calendar, supplier_calendar, test_resource
- Description
Module for resource management. =============================== A resource represent something that can be scheduled (a developer on a task or a work center on manufacturing orders). This module manages a resource calendar associated to every resource. It also manages the leaves of every resource.
Code Analysis ⓘ
Views touched (12)
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
resource_calendar_form |
resource.calendar.form | resource.calendar | form | New |
resource_calendar_leave_form |
resource.calendar.leaves.form | resource.calendar.leaves | form | New |
resource_calendar_leave_tree |
resource.calendar.leaves.list | resource.calendar.leaves | list | New |
resource_resource_form |
resource.resource.form | resource.resource | form | New |
resource_resource_tree |
resource.resource.list | resource.resource | list | New |
view_resource_calendar |
resource.calendar.leaves.calendar | resource.calendar.leaves | calendar | New |
view_resource_calendar_attendance_form |
resource.calendar.attendance.form | resource.calendar.attendance | form | New |
view_resource_calendar_attendance_tree |
resource.calendar.attendance.list | resource.calendar.attendance | list | New |
view_resource_calendar_leaves_search |
resource.calendar.leaves.search | resource.calendar.leaves | search | New |
view_resource_calendar_search |
resource.calendar.search | resource.calendar | search | New |
view_resource_calendar_tree |
resource.calendar.list | resource.calendar | list | New |
view_resource_resource_search |
resource.resource.search | resource.resource | search | New |
HTTP endpoints (0)
No HTTP endpoints found for this module.
Models touched (7)
New fields (2)
-
resource_calendar_idMany2one → resource.calendarondelete='restrict' args: 'resource.calendar', 'Default Working Hours' -
resource_calendar_idsOne2many → resource.calendarargs: 'resource.calendar', 'company_id', 'Working Hours'
-
create(self, vals_list)@api.model_create_multi
New fields (2)
-
resource_calendar_idMany2one → resource.calendarreadonly=Falserelated='resource_ids.calendar_id' args: 'resource.calendar', 'Default Working Hours' -
resource_idsOne2many → resource.resourceargs: 'resource.resource', 'user_id', 'Resources'
-
write(self, vals)
New fields (21)
-
activeBooleandefault=Truehelp='If the active field is set to false, it will allow you to hide the Working Time without removing it.' args: 'Active' -
attendance_idsOne2many → resource.calendar.attendancecompute='_compute_attendance_ids'copy=Truereadonly=Falsestore=True args: 'resource.calendar.attendance', 'calendar_id', 'Working Time' -
attendance_ids_1st_weekOne2many → resource.calendar.attendancecompute='_compute_two_weeks_attendance'inverse='_inverse_two_weeks_calendar' args: 'resource.calendar.attendance', 'calendar_id', 'Working Time 1st Week' -
attendance_ids_2nd_weekOne2many → resource.calendar.attendancecompute='_compute_two_weeks_attendance'inverse='_inverse_two_weeks_calendar' args: 'resource.calendar.attendance', 'calendar_id', 'Working Time 2nd Week' -
company_idMany2one → res.companydefault=<expr>domain=<expr>index='btree_not_null' args: 'res.company', 'Company' -
duration_basedBooleanhelp='The hours will be centered around 12:00 to cover the duration for the day' args: 'Attendance based on duration' -
flexible_hoursBooleancompute='_compute_flexible_hours'help="When enabled, it will allow employees to work flexibly, without relying on the company's working schedule (working hours)."inverse='_inverse_flexible_hours'store=Truestring='Flexible Hours' -
full_time_required_hoursFloatcompute='_compute_full_time_required_hours'help='Number of hours to work on the company schedule to be considered as fulltime.'readonly=Falsestore=Truestring='Full Time Equivalent' -
global_leave_idsOne2many → resource.calendar.leavescompute='_compute_global_leave_ids'copy=Truedomain=[('resource_id', '=', False)]readonly=Falsestore=True args: 'resource.calendar.leaves', 'calendar_id', 'Global Time Off' -
hours_per_dayFloatcompute='_compute_hours_per_day'digits=(2, 2)help='Average hours per day a resource is supposed to work with this calendar.'readonly=Falsestore=True args: 'Average Hour per Day' -
hours_per_weekFloatcompute='_compute_hours_per_week'copy=Falsereadonly=Falsestore=Truestring='Hours per Week' -
is_fulltimeBooleancompute='_compute_work_time_rate'string='Is Full Time' -
leave_idsOne2many → resource.calendar.leavesargs: 'resource.calendar.leaves', 'calendar_id', 'Time Off' -
nameCharrequired=True -
schedule_typeSelectiondefault='fully_fixed'help='Choose which level of definition you want to define on your Schedule\n- Flexible : Define an amount of hours to work on the week.\n- Fully Fixed : define the days, periods and the start & end time for each period of the day'required=Truestring='Schedule Type' args: [('flexible', 'Flexible'), ('fully_fixed', 'Fully Fixed')] -
two_weeks_calendarBooleanstring='Calendar in 2 weeks mode' -
two_weeks_explanationCharcompute='_compute_two_weeks_explanation' args: 'Explanation' -
tzSelectiondefault=<expr>help='This field is used in order to define in which timezone the resources will work.'required=Truestring='Timezone' args: _tz_get -
tz_offsetCharcompute='_compute_tz_offset'string='Timezone offset' -
work_resources_countIntegercompute='_compute_work_resources_count' args: 'Work Resources count' -
work_time_rateFloatcompute='_compute_work_time_rate'help='Work time rate versus full time working schedule, should be between 0 and 100 %.'search='_search_work_time_rate'string='Work Time Rate'
-
copy_data(self, default=None) -
create(self, vals_list)@api.model_create_multi -
default_get(self, fields)@api.model -
get_work_duration_data(self, from_datetime, to_datetime, compute_leaves=True, domain=None)Get the working duration (in days and hours) for a given period, only based on the current calendar. This method does not use resource to compute it. `domain` is used in order to recognise the leaves to take, None means default value ('time_type', '=', 'leave') Returns a dict {'days': n, 'hours': h} containing the quantity of working time expressed as days and as hours. -
get_work_hours_count(self, start_dt, end_dt, compute_leaves=True, domain=None)`compute_leaves` controls whether or not this method is taking into account the global leaves. `domain` controls the way leaves are recognized. None means default value ('time_type', '=', 'leave') Counts the number of work hours between two datetimes. -
plan_days(self, days, day_dt, compute_leaves=False, domain=None)`compute_leaves` controls whether or not this method is taking into account the global leaves. `domain` controls the way leaves are recognized. None means default value ('time_type', '=', 'leave') Returns the datetime of a days scheduling. -
plan_hours(self, hours, day_dt, compute_leaves=False, domain=None, resource=None)`compute_leaves` controls whether or not this method is taking into account the global leaves. `domain` controls the way leaves are recognized. None means default value ('time_type', '=', 'leave') Return datetime after having planned hours -
switch_based_on_duration(self) -
switch_calendar_type(self)
New fields (13)
-
calendar_idMany2one → resource.calendarindex=Trueondelete='cascade'required=Truestring="Resource's Calendar" args: 'resource.calendar' -
day_periodSelectiondefault='morning'required=True args: [('morning', 'Morning'), ('lunch', 'Break'), ('afternoon', 'Afternoon'), ('full_day', 'Full Day')] -
dayofweekSelectiondefault='0'index=Truerequired=True args: [('0', 'Monday'), ('1', 'Tuesday'), ('2', 'Wednesday'), ('3', 'Thursday'), ('4', 'Friday'), ('5', 'Saturday'), ('6', 'Sunday')], 'Day of Week' -
display_typeSelectiondefault=Falsehelp='Technical field for UX purpose.' args: [('line_section', 'Section')] -
duration_basedBooleanrelated='calendar_id.duration_based' -
duration_daysFloatcompute='_compute_duration_days'readonly=Falsestore=Truestring='Duration (days)' -
duration_hoursFloatcompute='_compute_duration_hours'inverse='_inverse_duration_hours'readonly=Falsestore=Truestring='Duration (hours)' -
hour_fromFloatdefault=0help='Start and End time of working.\nA specific value of 24:00 is interpreted as 23:59:59.999999.'index=Truerequired=Truestring='Work from' -
hour_toFloatdefault=0required=Truestring='Work to' -
nameCharrequired=True -
sequenceIntegerdefault=10help='Gives the sequence of this line when displaying the resource calendar.' -
two_weeks_calendarBooleanrelated='calendar_id.two_weeks_calendar' args: 'Calendar in 2 weeks mode' -
week_typeSelectiondefault=False args: [('1', 'Second'), ('0', 'First')], 'Week Number'
-
get_week_type(self, date)@api.model
New fields (7)
-
calendar_idMany2one → resource.calendarcheck_company=Truecompute='_compute_calendar_id'domain="[('company_id', 'in', [company_id, False])]"index=Truereadonly=Falsestore=True args: 'resource.calendar', 'Working Hours' -
company_idMany2one → res.companycompute='_compute_company_id'default=<expr>readonly=Truestore=Truestring='Company' args: 'res.company' -
date_fromDatetimerequired=True args: 'Start Date' -
date_toDatetimecompute='_compute_date_to'readonly=Falserequired=Truestore=True args: 'End Date' -
nameCharargs: 'Reason' -
resource_idMany2one → resource.resourcehelp='If empty, this is a generic time off for the company. If a resource is set, the time off is only for this resource'index=True args: 'resource.resource', 'Resource' -
time_typeSelectiondefault='leave'help='Whether this should be computed as a time off or as work time (eg: formation)' args: [('leave', 'Time Off'), ('other', 'Other')]
-
check_dates(self)@api.constrains('date_from', 'date_to') -
default_get(self, fields)@api.model
New fields (4)
-
company_idMany2one → res.companydefault=<expr>index=Trueprecompute=Truereadonly=Falserelated='resource_id.company_id'store=True args: 'res.company', 'Company' -
resource_calendar_idMany2one → resource.calendardefault=<expr>index=Truereadonly=Falserelated='resource_id.calendar_id'store=True args: 'resource.calendar', 'Working Hours' -
resource_idMany2one → resource.resourcebypass_search_access=Trueindex=Trueondelete='restrict'required=True args: 'resource.resource', 'Resource' -
tzSelectionhelp='This field is used in order to define in which timezone the resources will work.'readonly=Falserelated='resource_id.tz'string='Timezone'
-
copy_data(self, default=None) -
create(self, vals_list)@api.model_create_multi -
list_leaves(self, from_datetime, to_datetime, calendar=None, domain=None)By default the resource calendar is used, but it can be changed using the `calendar` argument. `domain` is used in order to recognise the leaves to take, None means default value ('time_type', '=', 'leave') Returns a list of tuples (day, hours, resource.calendar.leaves) for each leave in the calendar.
New fields (12)
-
activeBooleandefault=Truehelp='If the active field is set to False, it will allow you to hide the resource record without removing it.' args: 'Active' -
avatar_128Imagecompute='_compute_avatar_128' -
calendar_idMany2one → resource.calendardefault=<expr>domain="[('company_id', '=', company_id)]"help='Define the working schedule of the resource. If not set, the resource will have fully flexible working hours.'string='Working Time' args: 'resource.calendar' -
company_idMany2one → res.companydefault=<expr>string='Company' args: 'res.company' -
emailCharrelated='user_id.email' -
nameCharrequired=True -
phoneCharrelated='user_id.phone' -
resource_typeSelectiondefault='user'required=Truestring='Type' args: [('user', 'Human'), ('material', 'Material')] -
shareBooleanrelated='user_id.share' -
time_efficiencyFloatdefault=100help='This field is used to calculate the expected duration of a work order at this work center. For example, if a work order takes one hour and the efficiency factor is 100%, then the expected duration will be one hour. If the efficiency factor is 200%, however the expected duration will be 30 minutes.'required=True args: 'Efficiency Factor' -
tzSelectiondefault=<expr>required=Truestring='Timezone' args: _tz_get -
user_idMany2one → res.usershelp='Related user name for the resource to manage its access.'index='btree_not_null'string='User' args: 'res.users'
-
copy_data(self, default=None) -
create(self, vals_list)@api.model_create_multi -
default_get(self, fields)@api.model -
write(self, vals)
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…