diff --git a/hr_timesheet_task_domain/README.rst b/hr_timesheet_task_domain/README.rst new file mode 100644 index 000000000..c2c90dc56 --- /dev/null +++ b/hr_timesheet_task_domain/README.rst @@ -0,0 +1,94 @@ +=============================== +Task Log: limit Task by Project +=============================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:2317055a20e1a783560f84e8a2e1b443c9ea19afb1de189abaa0232671e797df + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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_task_domain + :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_task_domain + :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| + +This module adjusts the domain applied to task field in order to limit +task selection to currently-selected project, also limits selection to +tasks in any of "Open" stages in order to accommodate a project flow. + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Tecnativa +* CorporateHub + +Contributors +------------ + +- `Tecnativa `__: + + - Pedro M. Baeza + - Antonio Espinosa + - Carlos Dauden + - Sergio Teruel + - Luis M. ontalba + - Ernesto Tejeda + - Manuel Calero + - Yadier Quesada + +- `CorporateHub `__ + + - Alexey Pelykh + +- Foram Shah + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/hr_timesheet_task_domain/__init__.py b/hr_timesheet_task_domain/__init__.py new file mode 100644 index 000000000..4b76c7b2d --- /dev/null +++ b/hr_timesheet_task_domain/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/hr_timesheet_task_domain/__manifest__.py b/hr_timesheet_task_domain/__manifest__.py new file mode 100644 index 000000000..663c9dc01 --- /dev/null +++ b/hr_timesheet_task_domain/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2016 Tecnativa - Antonio Espinosa +# Copyright 2016 Tecnativa - Sergio Teruel +# Copyright 2016-2018 Tecnativa - Pedro M. Baeza +# Copyright 2018 Tecnativa - Ernesto Tejeda +# Copyright 2019 Brainbean Apps (https://brainbeanapps.com) +# Copyright 2020 Tecnativa - Manuel Calero +# Copyright 2020 CorporateHub (https://corporatehub.eu) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +{ + "name": "Task Log: limit Task by Project", + "version": "17.0.1.0.0", + "category": "Human Resources", + "website": "https://github.com/OCA/timesheet", + "author": "Tecnativa, CorporateHub, Odoo Community Association (OCA)", + "license": "AGPL-3", + "installable": True, + "application": False, + "summary": ("Limit task selection to tasks on currently-selected project"), + "depends": ["hr_timesheet"], +} diff --git a/hr_timesheet_task_domain/i18n/de.po b/hr_timesheet_task_domain/i18n/de.po new file mode 100644 index 000000000..eedc101ce --- /dev/null +++ b/hr_timesheet_task_domain/i18n/de.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_timesheet_task_domain +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-07-11 12:43+0000\n" +"Last-Translator: Maria Sparenberg \n" +"Language-Team: none\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.7.1\n" + +#. module: hr_timesheet_task_domain +#: model:ir.model,name:hr_timesheet_task_domain.model_account_analytic_line +msgid "Analytic Line" +msgstr "Kostenstellenbuchung" + +#. module: hr_timesheet_task_domain +#: model:ir.model.fields,field_description:hr_timesheet_task_domain.field_account_analytic_line__task_id +msgid "Task" +msgstr "" diff --git a/hr_timesheet_task_domain/i18n/es.po b/hr_timesheet_task_domain/i18n/es.po new file mode 100644 index 000000000..dae41ed6b --- /dev/null +++ b/hr_timesheet_task_domain/i18n/es.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_timesheet_task_domain +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-09-03 05:14+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: hr_timesheet_task_domain +#: model:ir.model,name:hr_timesheet_task_domain.model_account_analytic_line +msgid "Analytic Line" +msgstr "Línea analítica" + +#. module: hr_timesheet_task_domain +#: model:ir.model.fields,field_description:hr_timesheet_task_domain.field_account_analytic_line__task_id +msgid "Task" +msgstr "Tarea" diff --git a/hr_timesheet_task_domain/i18n/fr.po b/hr_timesheet_task_domain/i18n/fr.po new file mode 100644 index 000000000..ee5407b74 --- /dev/null +++ b/hr_timesheet_task_domain/i18n/fr.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_timesheet_task_domain +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-10-05 15:29+0000\n" +"Last-Translator: Vincent Hatakeyama \n" +"Language-Team: none\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: hr_timesheet_task_domain +#: model:ir.model,name:hr_timesheet_task_domain.model_account_analytic_line +msgid "Analytic Line" +msgstr "Ligne analytique" + +#. module: hr_timesheet_task_domain +#: model:ir.model.fields,field_description:hr_timesheet_task_domain.field_account_analytic_line__task_id +msgid "Task" +msgstr "" diff --git a/hr_timesheet_task_domain/i18n/hr_timesheet_task_domain.pot b/hr_timesheet_task_domain/i18n/hr_timesheet_task_domain.pot new file mode 100644 index 000000000..2e8e7f740 --- /dev/null +++ b/hr_timesheet_task_domain/i18n/hr_timesheet_task_domain.pot @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_timesheet_task_domain +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_task_domain +#: model:ir.model,name:hr_timesheet_task_domain.model_account_analytic_line +msgid "Analytic Line" +msgstr "" + +#. module: hr_timesheet_task_domain +#: model:ir.model.fields,field_description:hr_timesheet_task_domain.field_account_analytic_line__task_id +msgid "Task" +msgstr "" diff --git a/hr_timesheet_task_domain/i18n/it.po b/hr_timesheet_task_domain/i18n/it.po new file mode 100644 index 000000000..6e35f1883 --- /dev/null +++ b/hr_timesheet_task_domain/i18n/it.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_timesheet_task_domain +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-07-08 08:43+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: hr_timesheet_task_domain +#: model:ir.model,name:hr_timesheet_task_domain.model_account_analytic_line +msgid "Analytic Line" +msgstr "Riga analitica" + +#. module: hr_timesheet_task_domain +#: model:ir.model.fields,field_description:hr_timesheet_task_domain.field_account_analytic_line__task_id +msgid "Task" +msgstr "Attività" diff --git a/hr_timesheet_task_domain/i18n/pt_BR.po b/hr_timesheet_task_domain/i18n/pt_BR.po new file mode 100644 index 000000000..280481cc0 --- /dev/null +++ b/hr_timesheet_task_domain/i18n/pt_BR.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_timesheet_task_domain +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-10-27 21:55+0000\n" +"Last-Translator: Adriano Prado \n" +"Language-Team: none\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: hr_timesheet_task_domain +#: model:ir.model,name:hr_timesheet_task_domain.model_account_analytic_line +msgid "Analytic Line" +msgstr "Linha Analítica" + +#. module: hr_timesheet_task_domain +#: model:ir.model.fields,field_description:hr_timesheet_task_domain.field_account_analytic_line__task_id +msgid "Task" +msgstr "Tarefa" diff --git a/hr_timesheet_task_domain/models/__init__.py b/hr_timesheet_task_domain/models/__init__.py new file mode 100644 index 000000000..977639646 --- /dev/null +++ b/hr_timesheet_task_domain/models/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import account_analytic_line diff --git a/hr_timesheet_task_domain/models/account_analytic_line.py b/hr_timesheet_task_domain/models/account_analytic_line.py new file mode 100644 index 000000000..8e6418b0b --- /dev/null +++ b/hr_timesheet_task_domain/models/account_analytic_line.py @@ -0,0 +1,24 @@ +# Copyright 2016 Tecnativa - Antonio Espinosa +# Copyright 2016 Tecnativa - Sergio Teruel +# Copyright 2016-2018 Tecnativa - Pedro M. Baeza +# Copyright 2019 Brainbean Apps (https://brainbeanapps.com) +# Copyright 2024 Tecnativa - Víctor Martínez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + +from odoo.addons.project.models.project_task import CLOSED_STATES + + +class AccountAnalyticLine(models.Model): + _inherit = "account.analytic.line" + + task_id = fields.Many2one( + domain="project_id and [('company_id', 'in', (company_id, False)), " + "('project_id.allow_timesheets', '=', True), " + "('state', 'not in', " + str(list(CLOSED_STATES.keys())) + "), " + "('project_id', '=', project_id)] " + "or [('company_id', 'in', (company_id, False)), " + "('project_id.allow_timesheets', '=', True), " + "('project_id', '=?', project_id)]", + ) diff --git a/hr_timesheet_task_domain/pyproject.toml b/hr_timesheet_task_domain/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/hr_timesheet_task_domain/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/hr_timesheet_task_domain/readme/CONTRIBUTORS.md b/hr_timesheet_task_domain/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..f256cc87e --- /dev/null +++ b/hr_timesheet_task_domain/readme/CONTRIBUTORS.md @@ -0,0 +1,16 @@ +- [Tecnativa](https://www.tecnativa.com): + + > - Pedro M. Baeza + > - Antonio Espinosa + > - Carlos Dauden + > - Sergio Teruel + > - Luis M. ontalba + > - Ernesto Tejeda + > - Manuel Calero + > - Yadier Quesada + +- [CorporateHub](https://corporatehub.eu/) + + - Alexey Pelykh \<\> + +- Foram Shah \<\> diff --git a/hr_timesheet_task_domain/readme/DESCRIPTION.md b/hr_timesheet_task_domain/readme/DESCRIPTION.md new file mode 100644 index 000000000..f29b9da78 --- /dev/null +++ b/hr_timesheet_task_domain/readme/DESCRIPTION.md @@ -0,0 +1,3 @@ +This module adjusts the domain applied to task field in order to limit +task selection to currently-selected project, also limits selection to +tasks in any of "Open" stages in order to accommodate a project flow. diff --git a/hr_timesheet_task_domain/static/description/icon.png b/hr_timesheet_task_domain/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/hr_timesheet_task_domain/static/description/icon.png differ diff --git a/hr_timesheet_task_domain/static/description/index.html b/hr_timesheet_task_domain/static/description/index.html new file mode 100644 index 000000000..ba79094b6 --- /dev/null +++ b/hr_timesheet_task_domain/static/description/index.html @@ -0,0 +1,443 @@ + + + + + +Task Log: limit Task by Project + + + +
+

Task Log: limit Task by Project

+ + +

Beta License: AGPL-3 OCA/timesheet Translate me on Weblate Try me on Runboat

+

This module adjusts the domain applied to task field in order to limit +task selection to currently-selected project, also limits selection to +tasks in any of “Open” stages in order to accommodate a project flow.

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
  • CorporateHub
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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 project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ +