Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
208 changes: 208 additions & 0 deletions hr_shift/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
================
Employees Shifts
================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:bb65c16d9fb914f1765e25542abc428eb7aa339eebb3068857d7bd024a2e1915
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fshift--planning-lightgray.png?logo=github
:target: https://github.com/OCA/shift-planning/tree/18.0/hr_shift
:alt: OCA/shift-planning
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/shift-planning-18-0/shift-planning-18-0-hr_shift
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/shift-planning&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Shifts to employees with variable work schedules.

**Table of contents**

.. contents::
:local:

Configuration
=============

In order to configure and create shift plannings you'll need to be in
the **Shift Manager** security group.

Creating shifts
---------------

Go to *Shifts > Shifts* and create a new one. Define a name, a color (it
will be used in the shifts assignment cards), a start and end time, a
time zone and week days span.

Create as many as you need to.

Setting employees with variable shifts.
---------------------------------------

Go to *Employees > Employees* and in the tab *Work information* go to
the *Schedule* section. There you can set the **Shift planning**
checkbox if this employee should have a shift generated automatically in
the weekly plannings.

Setting the default work week
-----------------------------

Go to *Settings > Employees* and in the *Work organization* section you
can define the default working week for your company. By default it goes
from Monday to Friday.

Usage
=====

After configuring the application we can start making plannings. To
create a new one:

1. Go to *Shifts > Plannings* and click on *Create*.
2. Set the year and week number for the planning and click *Save*.
3. Now click on *Generate* to pre-create the shifts assignments for your
employees.

You can start assigning shifts click on the *Shifts* smart button where
you'll go to a kanban view with a card per employee that you can drag
into the corresponding shift. Once you do it, you'll the color of the
week days in the card changes to the color of the shift assigned.

|Drag to assign|

Now if you want to assign a different shift for a specific day of that
week to that employee, you can do so clicking on **Shift details**. In
the detailed kanban view drag the days to their corresponding shifts.

|Changing specific days|

Going back to the general assignment screen you'll see the difference in
the days list colors for the employee's card. Every day is clickable and
it will pop up the shift details for that specific day.

|Card with different shifts|

Detecting employees issues
--------------------------

An employee could be on leave for one or serveral days of a planning
week. In that case when an assignment is made for that employee the
overlapping days will be flagged as unavailable and no shift will be
assigned.

We can detect those issues from the general plannings view in *Shift >
Plannings*.

|Mark as reviewed|

To set the issue as reviewed we can click on the checkbox of the
employee's assignment card. It won't be counted on the issues summary
when is checked.

|image1|

Generate planning from another one
----------------------------------

We can generate plannings from other planning so we can copy the shifts
assigments. To do so you can either click on **Generate planning** from
the general plannings view in *Shifts > Plannings* or click on **Copy to
new planning** from the origin planning form.

In both cases a wizard will open where you can choose to which week will
the new planning correspond to and from which planning we'll be copying
the assignations.

Regenerate shifts.
------------------

We can reset the assignments from the planning form clicking on
*Regenerate shifts*.

My shifts
---------

All the internal users can view their assigned shifts going to *Shifts >
My shifts*.

.. |Drag to assign| image:: https://raw.githubusercontent.com/OCA/shift-planning/18.0/hr_shift/static/description/assignment_dragging.gif
.. |Changing specific days| image:: https://raw.githubusercontent.com/OCA/shift-planning/18.0/hr_shift/static/description/assignment_details_dragging.gif
.. |Card with different shifts| image:: https://raw.githubusercontent.com/OCA/shift-planning/18.0/hr_shift/static/description/week_days_colors.png
.. |Mark as reviewed| image:: https://raw.githubusercontent.com/OCA/shift-planning/18.0/hr_shift/static/description/planning_card.png
.. |image1| image:: https://raw.githubusercontent.com/OCA/shift-planning/18.0/hr_shift/static/description/reviewed_checkbox.png

Known issues / Roadmap
======================

- We can use the *Reviewed* field for more purposes, like setting the
planning state when all the shifts are reviewed.
- Support working pauses.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/shift-planning/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/shift-planning/issues/new?body=module:%20hr_shift%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Tecnativa

Contributors
------------

- `Tecnativa <https://tecnativa.com>`__:

- David Vidal
- Pedro M. Baeza

- `Tesseratech <https://www.tesseratech.es>`__:

- Abraham Anes

- `Grupo Isonor <https://www.grupoisonor.es>`__:

- David Palanca

Other credits
-------------

`Sun Moon icon <https://lucide.dev/icons/sun-moon>`__ by Lucide

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/shift-planning <https://github.com/OCA/shift-planning/tree/18.0/hr_shift>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions hr_shift/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizards
29 changes: 29 additions & 0 deletions hr_shift/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2024 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Employees Shifts",
"summary": "Define shifts for employees",
"version": "18.0.1.0.0",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/shift-planning",
"category": "Human Resources/Shifts",
"depends": ["hr", "base_sparse_field"],
"demo": ["demo/demo.xml"],
"data": [
"security/hr_shift_security.xml",
"security/ir.model.access.csv",
"views/shift_planning_views.xml",
"views/shift_template_views.xml",
"views/res_config_settings_views.xml",
"wizards/shift_planning_wizard_views.xml",
"views/hr_employee_views.xml",
],
"assets": {
"web.assets_backend": [
"/hr_shift/static/src/js/**/*.js",
"/hr_shift/static/src/scss/shift.scss",
"/hr_shift/static/src/xml/generate_planning_views.xml",
],
},
}
36 changes: 36 additions & 0 deletions hr_shift/demo/demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="template_morning" model="hr.shift.template">
<field name="name">Morning 8-14</field>
<field name="day_of_week_start">0</field>
<field name="day_of_week_end">4</field>
<field name="start_time">8</field>
<field name="end_time">14</field>
<field name="color">10</field>
</record>
<record id="template_afternoon" model="hr.shift.template">
<field name="name">Afternoon 14-20</field>
<field name="day_of_week_start">0</field>
<field name="day_of_week_end">4</field>
<field name="start_time">14</field>
<field name="end_time">20</field>
<field name="color">4</field>
</record>
<record id="hr.employee_admin" model="hr.employee">
<field name="shift_planning" eval="True" />
</record>
<record id="hr.employee_qdp" model="hr.employee">
<field name="shift_planning" eval="True" />
</record>
<record id="planning_2025_02" model="hr.shift.planning">
<field name="year">2025</field>
<field name="week_number">2</field>
<field name="start_date">2025-01-06</field>
<field name="end_date">2025-01-12</field>
</record>
<function
model="hr.shift.planning"
name="generate_shifts"
eval="[[ref('planning_2025_02')]]"
/>
</odoo>
Loading