Skip to content
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
6 changes: 6 additions & 0 deletions setup/web_calendar_workdays/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
138 changes: 138 additions & 0 deletions web_calendar_workdays/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=======================
Calendar workdays views
=======================

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

.. |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/license-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/16.0/web_calendar_workdays
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_calendar_workdays
: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/web&target_branch=16.0
:alt: Try me on Runboat

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

This module adds two opt-in calendar scales to the Odoo backend calendar
view:

- **Work Week**: same as the standard week view, but hides weekend.
- **Work Month**: same as the standard month view, but hides weekends.

**Table of contents**

.. contents::
:local:

Usage
=====

The new ``work_week`` and ``work_month`` scales are **opt-in** per
calendar view. To enable them, list them explicitly in the ``scales``
attribute of the ``<calendar>`` element:

.. code:: xml

<calendar
date_start="date_start"
date_stop="date_stop"
mode="work_week"
scales="day,week,work_week,month,work_month,year"
>
...
</calendar>

Notes:

- The standard scales (``day``, ``week``, ``month``, ``year``) are
still controlled the same way. List only the ones you want to expose
in the scale selector.
- You can use ``work_week`` or ``work_month`` as the default ``mode``.
- If the ``scales`` attribute is omitted, only the four standard scales
are available, preserving backward compatibility.

To inherit an existing calendar view and add the new scales:

.. code:: xml

<record id="my_calendar_view_workdays" model="ir.ui.view">
<field name="name">my.model.calendar.workdays</field>
<field name="model">my.model</field>
<field name="inherit_id" ref="other_module.my_calendar_view"/>
<field name="arch" type="xml">
<xpath expr="//calendar" position="attributes">
<attribute name="scales">day,week,work_week,month,work_month,year</attribute>
</xpath>
</field>
</record>

The view will then show two additional entries (``Work Week`` and
``Work Month``) in the scale dropdown next to ``Day`` / ``Week`` /
``Month`` / ``Year``.

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

Use employee working hours to determine weekends and not use Saturday
and Sunday as default weekend days.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/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/web/issues/new?body=module:%20web_calendar_workdays%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
-------

* ForgeFlow

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

- `ForgeFlow <https://www.forgeflow.com>`__:

- Andreu Orensanz

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/web <https://github.com/OCA/web/tree/16.0/web_calendar_workdays>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Empty file.
26 changes: 26 additions & 0 deletions web_calendar_workdays/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2026 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
{
"name": "Calendar workdays views",
"summary": "Adds opt-in Work Week and Work Month calendar scales that hide "
"weekend days (Saturday and Sunday)",
"version": "16.0.1.0.0",
"development_status": "Beta",
"category": "Extra Tools",
"website": "https://github.com/OCA/web",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"license": "LGPL-3",
"application": False,
"installable": True,
"depends": ["web"],
"assets": {
"web.assets_backend": [
"web_calendar_workdays/static/src/js/calendar_arch_parser.esm.js",
"web_calendar_workdays/static/src/js/calendar_renderer.esm.js",
"web_calendar_workdays/static/src/js/calendar_common_renderer.esm.js",
"web_calendar_workdays/static/src/js/calendar_controller.esm.js",
"web_calendar_workdays/static/src/js/calendar_model.esm.js",
"web_calendar_workdays/static/src/js/calendar_date_picker.esm.js",
],
},
}
30 changes: 30 additions & 0 deletions web_calendar_workdays/i18n/ca_ES.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_calendar_workdays
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-05-12 10:04+0000\n"
"PO-Revision-Date: 2026-05-12 10:04+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: web_calendar_workdays
#. odoo-javascript
#: code:addons/web_calendar_workdays/static/src/js/calendar_controller.esm.js:0
#, python-format
msgid "Work Month"
msgstr "Mes laboral"

#. module: web_calendar_workdays
#. odoo-javascript
#: code:addons/web_calendar_workdays/static/src/js/calendar_controller.esm.js:0
#, python-format
msgid "Work Week"
msgstr "Setmana laboral"
30 changes: 30 additions & 0 deletions web_calendar_workdays/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_calendar_workdays
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-05-12 10:04+0000\n"
"PO-Revision-Date: 2026-05-12 10:04+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: web_calendar_workdays
#. odoo-javascript
#: code:addons/web_calendar_workdays/static/src/js/calendar_controller.esm.js:0
#, python-format
msgid "Work Month"
msgstr "Mes laboral"

#. module: web_calendar_workdays
#. odoo-javascript
#: code:addons/web_calendar_workdays/static/src/js/calendar_controller.esm.js:0
#, python-format
msgid "Work Week"
msgstr "Semana laboral"
2 changes: 2 additions & 0 deletions web_calendar_workdays/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [ForgeFlow](https://www.forgeflow.com):
- Andreu Orensanz
4 changes: 4 additions & 0 deletions web_calendar_workdays/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This module adds two opt-in calendar scales to the Odoo backend calendar view:

- **Work Week**: same as the standard week view, but hides weekend.
- **Work Month**: same as the standard month view, but hides weekends.
1 change: 1 addition & 0 deletions web_calendar_workdays/readme/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use employee working hours to determine weekends and not use Saturday and Sunday as default weekend days.
40 changes: 40 additions & 0 deletions web_calendar_workdays/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
The new `work_week` and `work_month` scales are **opt-in** per calendar view.
To enable them, list them explicitly in the `scales` attribute of the
`<calendar>` element:

```xml
<calendar
date_start="date_start"
date_stop="date_stop"
mode="work_week"
scales="day,week,work_week,month,work_month,year"
>
...
</calendar>
```

Notes:

- The standard scales (`day`, `week`, `month`, `year`) are still controlled the
same way. List only the ones you want to expose in the scale selector.
- You can use `work_week` or `work_month` as the default `mode`.
- If the `scales` attribute is omitted, only the four standard scales are
available, preserving backward compatibility.

To inherit an existing calendar view and add the new scales:

```xml
<record id="my_calendar_view_workdays" model="ir.ui.view">
<field name="name">my.model.calendar.workdays</field>
<field name="model">my.model</field>
<field name="inherit_id" ref="other_module.my_calendar_view"/>
<field name="arch" type="xml">
<xpath expr="//calendar" position="attributes">
<attribute name="scales">day,week,work_week,month,work_month,year</attribute>
</xpath>
</field>
</record>
```

The view will then show two additional entries (`Work Week` and `Work Month`)
in the scale dropdown next to `Day` / `Week` / `Month` / `Year`.
Loading
Loading