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
78 changes: 78 additions & 0 deletions project_timesheet_holidays_task_enable/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
===========================================
Project Timesheet Holidays - re-enable task
===========================================

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

.. |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/18.0/project_timesheet_holidays_task_enable
:alt: OCA/timesheet
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/timesheet-18-0/timesheet-18-0-project_timesheet_holidays_task_enable
: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=18.0
:alt: Try me on Runboat

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

When a task is used in leave types configuration, it cannot be used
filling manual timesheets. With this addon, it's possible to re-enable a
task affected by this limitation.

**Table of contents**

.. contents::
:local:

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:%20project_timesheet_holidays_task_enable%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
-------

* Solvos Consultoría Informática

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

- David ALonso <david.alonso@solvos.es>

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/18.0/project_timesheet_holidays_task_enable>`_ project on GitHub.

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

{
"name": "Project Timesheet Holidays - re-enable task",
"summary": "Re-enables task used in leave types",
"category": "Human Resources",
"version": "18.0.1.0.0",
"depends": ["project_timesheet_holidays"],
"data": ["views/project_task_views.xml"],
"author": "Solvos Consultoría Informática, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/timesheet",
"license": "AGPL-3",
"installable": True,
}
44 changes: 44 additions & 0 deletions project_timesheet_holidays_task_enable/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_timesheet_holidays_task_enable
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-10-08 13:42+0000\n"
"PO-Revision-Date: 2025-10-08 15:44+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: project_timesheet_holidays_task_enable
#: model:ir.model.fields,help:project_timesheet_holidays_task_enable.field_project_task__timeoff_enable_use_timesheets
msgid ""
"\n"
" For a time off task, re-enables it usage in timesheets\n"
" "
msgstr ""
"\n"
" Para una tarea de ausencias, se rehabilita su uso en partes de horas\n"
" "

#. module: project_timesheet_holidays_task_enable
#: model:ir.model.fields,field_description:project_timesheet_holidays_task_enable.field_project_task__timeoff_enable_use_timesheets
msgid "Enable use in timesheets when Used in Time Off"
msgstr "Permitir su uso en partes de horas aun cuando es usada en Ausencias"

#. module: project_timesheet_holidays_task_enable
#: model_terms:ir.ui.view,arch_db:project_timesheet_holidays_task_enable.view_task_form2_inherited
msgid "Enable use in timesheets when used in Time Off"
msgstr "Permitir su uso en partes de horas aun cuando es usada en Ausencias"

#. module: project_timesheet_holidays_task_enable
#: model:ir.model,name:project_timesheet_holidays_task_enable.model_project_task
msgid "Task"
msgstr "Tarea"
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_timesheet_holidays_task_enable
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-10-08 13:42+0000\n"
"PO-Revision-Date: 2025-10-08 13:42+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: project_timesheet_holidays_task_enable
#: model:ir.model.fields,help:project_timesheet_holidays_task_enable.field_project_task__timeoff_enable_use_timesheets
msgid ""
"\n"
" For a time off task, re-enables it usage in timesheets\n"
" "
msgstr ""

#. module: project_timesheet_holidays_task_enable
#: model:ir.model.fields,field_description:project_timesheet_holidays_task_enable.field_project_task__timeoff_enable_use_timesheets
msgid "Enable use in timesheets when Used in Time Off"
msgstr ""

#. module: project_timesheet_holidays_task_enable
#: model_terms:ir.ui.view,arch_db:project_timesheet_holidays_task_enable.view_task_form2_inherited
msgid "Enable use in timesheets when used in Time Off"
msgstr ""

#. module: project_timesheet_holidays_task_enable
#: model:ir.model,name:project_timesheet_holidays_task_enable.model_project_task
msgid "Task"
msgstr ""
1 change: 1 addition & 0 deletions project_timesheet_holidays_task_enable/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import project_task
35 changes: 35 additions & 0 deletions project_timesheet_holidays_task_enable/models/project_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# © 2025 Solvos Consultoría Informática (<https://www.solvos.es>)
# License LGPL-3 - See https://www.gnu.org/licenses/lgpl-3.0.html

from odoo import fields, models


class ProjectTask(models.Model):
_inherit = "project.task"

timeoff_enable_use_timesheets = fields.Boolean(
string="Enable use in timesheets when Used in Time Off",
help="""
For a time off task, re-enables it usage in timesheets
""",
)

def _compute_is_timeoff_task(self):
res = super()._compute_is_timeoff_task()
self.filtered(
lambda x: x.is_timeoff_task and x.timeoff_enable_use_timesheets
).is_timeoff_task = False
return res

def _search_is_timeoff_task(self, operator, value):
domain = super()._search_is_timeoff_task(operator, value)
domain_list = list(domain[0])

tasks_ids = domain_list[2]
new_tasks = self.browse(tasks_ids).filtered(
lambda x: x.timeoff_enable_use_timesheets
if value
else not x.timeoff_enable_use_timesheets
)
domain_list[2] = new_tasks.ids
return [tuple(domain_list)]
3 changes: 3 additions & 0 deletions project_timesheet_holidays_task_enable/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1. Go to Project > Task, select task that will be used as Leave Type. On Timesheet page and check "Enable use in timesheets when Used in Time Off"
2. On Time Off>Configuration>Leave Types, with Debug Mode, select Project and Task.
3. Now, from Timesheet, you can create with the enabled task.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* David ALonso \<david.alonso@solvos.es\>
2 changes: 2 additions & 0 deletions project_timesheet_holidays_task_enable/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
When a task is used in leave types configuration, it cannot be used filling manual timesheets.
With this addon, it's possible to re-enable a task affected by this limitation.
Loading
Loading