Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][ADD] resource_multi_week_calendar #1384

Open
wants to merge 14 commits into
base: 16.0
Choose a base branch
from
Open
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
120 changes: 120 additions & 0 deletions resource_multi_week_calendar/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
====================
Multi-week calendars
====================

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

.. |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%2Fhr-lightgray.png?logo=github
:target: https://github.com/OCA/hr/tree/16.0/resource_multi_week_calendar
:alt: OCA/hr
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/hr-16-0/hr-16-0-resource_multi_week_calendar
: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/hr&target_branch=16.0
:alt: Try me on Runboat

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

Allow a calendar to alternate between multiple weeks.

An implementation of this functionality exists in Odoo's ``resource`` module
since version 13. In Odoo's implementation, you can only alternate between two
weeks. Furthermore, the implementation is more than a little wonky.

The advantage of this module over the implementation in ``resource`` is that you
can alternate between more than two weeks. The implementation is (hopefully)
better.

The downside of adopting this module is that all modules which interact with the
week-alternating functionality of ``resource`` must be adapted to be compatible
with this module. At the time of writing (2024-07-29), the only Odoo module
which does this is ``hr_holidays``.

**Table of contents**

.. contents::
:local:

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

This module is a template for building on top of. It _will_ need glue modules to
work with various other modules. Most notably, ``hr_holidays`` will not work
without modification.

The existing base Odoo two-week calendar functionality is hidden rather than
disabled. This may or may not be desirable.

The module may need improvements for timezone handling; this is currently
untested. ``_split_into_weeks`` splits weeks on the timezone of the datetime
objects passed to it instead of on the timezone of the calendar. The calculation
of the current week number uses ``fields.Date.today()`` instead of the
environment's or calendar's timezone. Finally, child calendars may have a
different timezone compared to their parent, which is probably not a desired
feature.

This module assumes that a week always starts on a Monday. Upstream Odoo appears
to do the same, but this may not be desired by certain audiences.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/hr/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/hr/issues/new?body=module:%20resource_multi_week_calendar%0Aversion:%2016.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
~~~~~~~

* Coop IT Easy SC

Contributors
~~~~~~~~~~~~

* `Coop IT Easy SC <https://coopiteasy.be>`_:

* Carmen Bianca BAKKER

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.

.. |maintainer-carmenbianca| image:: https://github.com/carmenbianca.png?size=40px
:target: https://github.com/carmenbianca
:alt: carmenbianca

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-carmenbianca|

This module is part of the `OCA/hr <https://github.com/OCA/hr/tree/16.0/resource_multi_week_calendar>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions resource_multi_week_calendar/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-FileCopyrightText: 2024 Coop IT Easy SC
#
# SPDX-License-Identifier: AGPL-3.0-or-later

from . import models
22 changes: 22 additions & 0 deletions resource_multi_week_calendar/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# SPDX-FileCopyrightText: 2024 Coop IT Easy SC
#
# SPDX-License-Identifier: AGPL-3.0-or-later

{
"name": "Multi-week calendars",
"summary": """
Allow a calendar to alternate between multiple weeks.""",
"version": "16.0.1.0.0",
"category": "Hidden",
"website": "https://github.com/OCA/hr",
"author": "Coop IT Easy SC, Odoo Community Association (OCA)",
"maintainers": ["carmenbianca"],
"license": "AGPL-3",
"application": False,
"depends": [
"resource",
],
"data": [
"views/resource_calendar_views.xml",
],
}
5 changes: 5 additions & 0 deletions resource_multi_week_calendar/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-FileCopyrightText: 2024 Coop IT Easy SC
#
# SPDX-License-Identifier: AGPL-3.0-or-later

from . import resource_calendar
Loading
Loading