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
111 changes: 111 additions & 0 deletions hr_timesheet_day_week/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
========================
Timesheets - Day of Week
========================

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

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

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

For timesheets, enables search, group by the day of the week. This is
useful when e.g. weekend timesheets needs to be located.

**Table of contents**

.. contents::
:local:

Usage
=====

Now it's possible to search by and/or group by day of week for
timesheets:

|Search by day of week|

|Group by day of week|

For timesheet and timesheet report list views, it's possible to view in
a different color those timesheets that belong to weekends:

|Colored list|

and additionally use a filter for them:

|Filter by weekend timesheets|

.. |Search by day of week| image:: https://raw.githubusercontent.com/OCA/timesheet/17.0/hr_timesheet_day_week/static/img/01_search.png
.. |Group by day of week| image:: https://raw.githubusercontent.com/OCA/timesheet/17.0/hr_timesheet_day_week/static/img/02_groupby.png
.. |Colored list| image:: https://raw.githubusercontent.com/OCA/timesheet/17.0/hr_timesheet_day_week/static/img/03_list.png
.. |Filter by weekend timesheets| image:: https://raw.githubusercontent.com/OCA/timesheet/17.0/hr_timesheet_day_week/static/img/04_filter.png

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

- Make weekend definition parametrized, as there are countries around
the world that their weekend days are different than usual western
Saturday and Sunday days.

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

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

* Solvos

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

- `Solvos <https://www.solvos.es>`__:

- David Alonso
- Adrián Resúa

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/timesheet <https://github.com/OCA/timesheet/tree/17.0/hr_timesheet_day_week>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions hr_timesheet_day_week/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .hooks import pre_init_hook
from . import models
from . import report
15 changes: 15 additions & 0 deletions hr_timesheet_day_week/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# © 2025 Solvos Consultoría Informática (<http://www.solvos.es>)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

{
"name": "Timesheets - Day of Week",
"category": "Human Resources",
"version": "17.0.1.0.0",
"depends": ["hr_timesheet"],
"data": ["views/hr_timesheet_view.xml"],
"author": "Solvos, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/timesheet",
"license": "AGPL-3",
"pre_init_hook": "pre_init_hook",
"installable": True,
}
30 changes: 30 additions & 0 deletions hr_timesheet_day_week/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# © 2025 Solvos Consultoría Informática (<http://www.solvos.es>)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

import logging

from odoo.tools.sql import column_exists

logger = logging.getLogger(__name__)


def pre_init_hook(env):
if not column_exists(env.cr, "account_analytic_line", "day_week"):
logger.info("Creating field day_week on account_analytic_line")
env.cr.execute(
"""
ALTER TABLE account_analytic_line
ADD COLUMN day_week character varying
"""
)
logger.info("Updating field day_week for account_analytic_line records")
env.cr.execute(
"""
UPDATE account_analytic_line
SET day_week = (
CASE DATE_PART('dow', date)
WHEN 0 THEN 6
ELSE DATE_PART('dow', date) - 1
END)::character varying
"""
)
82 changes: 82 additions & 0 deletions hr_timesheet_day_week/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_timesheet_day_week
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-07-01 17:49+0000\n"
"PO-Revision-Date: 2025-07-01 19:50+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.4.2\n"

#. module: hr_timesheet_day_week
#: model:ir.model,name:hr_timesheet_day_week.model_account_analytic_line
msgid "Analytic Line"
msgstr "Línea analítica"

#. module: hr_timesheet_day_week
#: model:ir.model.fields,field_description:hr_timesheet_day_week.field_account_analytic_line__day_week
#: model:ir.model.fields,field_description:hr_timesheet_day_week.field_timesheets_analysis_report__day_week
#: model_terms:ir.ui.view,arch_db:hr_timesheet_day_week.hr_timesheet_line_search
msgid "Day of Week"
msgstr "Día de la semana"

#. module: hr_timesheet_day_week
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__account_analytic_line__day_week__4
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__timesheets_analysis_report__day_week__4
msgid "Friday"
msgstr "Viernes"

#. module: hr_timesheet_day_week
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__account_analytic_line__day_week__0
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__timesheets_analysis_report__day_week__0
msgid "Monday"
msgstr "Lunes"

#. module: hr_timesheet_day_week
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__account_analytic_line__day_week__5
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__timesheets_analysis_report__day_week__5
msgid "Saturday"
msgstr "Sábado"

#. module: hr_timesheet_day_week
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__account_analytic_line__day_week__6
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__timesheets_analysis_report__day_week__6
msgid "Sunday"
msgstr "Domingo"

#. module: hr_timesheet_day_week
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__account_analytic_line__day_week__3
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__timesheets_analysis_report__day_week__3
msgid "Thursday"
msgstr "Jueves"

#. module: hr_timesheet_day_week
#: model:ir.model,name:hr_timesheet_day_week.model_timesheets_analysis_report
msgid "Timesheets Analysis Report"
msgstr "Informe de análisis de partes de horas"

#. module: hr_timesheet_day_week
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__account_analytic_line__day_week__1
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__timesheets_analysis_report__day_week__1
msgid "Tuesday"
msgstr "Martes"

#. module: hr_timesheet_day_week
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__account_analytic_line__day_week__2
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__timesheets_analysis_report__day_week__2
msgid "Wednesday"
msgstr "Miércoles"

#. module: hr_timesheet_day_week
#: model_terms:ir.ui.view,arch_db:hr_timesheet_day_week.hr_timesheet_line_search
msgid "Weekend"
msgstr "Fin de semana"
78 changes: 78 additions & 0 deletions hr_timesheet_day_week/i18n/hr_timesheet_day_week.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_timesheet_day_week
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \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: hr_timesheet_day_week
#: model:ir.model,name:hr_timesheet_day_week.model_account_analytic_line
msgid "Analytic Line"
msgstr ""

#. module: hr_timesheet_day_week
#: model:ir.model.fields,field_description:hr_timesheet_day_week.field_account_analytic_line__day_week
#: model:ir.model.fields,field_description:hr_timesheet_day_week.field_timesheets_analysis_report__day_week
#: model_terms:ir.ui.view,arch_db:hr_timesheet_day_week.hr_timesheet_line_search
msgid "Day of Week"
msgstr ""

#. module: hr_timesheet_day_week
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__account_analytic_line__day_week__4
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__timesheets_analysis_report__day_week__4
msgid "Friday"
msgstr ""

#. module: hr_timesheet_day_week
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__account_analytic_line__day_week__0
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__timesheets_analysis_report__day_week__0
msgid "Monday"
msgstr ""

#. module: hr_timesheet_day_week
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__account_analytic_line__day_week__5
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__timesheets_analysis_report__day_week__5
msgid "Saturday"
msgstr ""

#. module: hr_timesheet_day_week
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__account_analytic_line__day_week__6
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__timesheets_analysis_report__day_week__6
msgid "Sunday"
msgstr ""

#. module: hr_timesheet_day_week
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__account_analytic_line__day_week__3
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__timesheets_analysis_report__day_week__3
msgid "Thursday"
msgstr ""

#. module: hr_timesheet_day_week
#: model:ir.model,name:hr_timesheet_day_week.model_timesheets_analysis_report
msgid "Timesheets Analysis Report"
msgstr ""

#. module: hr_timesheet_day_week
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__account_analytic_line__day_week__1
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__timesheets_analysis_report__day_week__1
msgid "Tuesday"
msgstr ""

#. module: hr_timesheet_day_week
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__account_analytic_line__day_week__2
#: model:ir.model.fields.selection,name:hr_timesheet_day_week.selection__timesheets_analysis_report__day_week__2
msgid "Wednesday"
msgstr ""

#. module: hr_timesheet_day_week
#: model_terms:ir.ui.view,arch_db:hr_timesheet_day_week.hr_timesheet_line_search
msgid "Weekend"
msgstr ""
Loading