diff --git a/hr_timesheet_task_required/README.rst b/hr_timesheet_task_required/README.rst new file mode 100644 index 0000000000..1ae0b6cbad --- /dev/null +++ b/hr_timesheet_task_required/README.rst @@ -0,0 +1,104 @@ +========================== +Hr Timesheet Task Required +========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:f8501c73ef6470fdc79a7a9a6b2e05c513be62054670b2e2840f061a009c2fdb + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/hr_timesheet_task_required + :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-hr_timesheet_task_required + :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| + +This module allows to configure project as having task on timesheet as a +mandatory field. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +To make task selection mandatory on project's timesheets: + +# Go to *Project > Projects* and edit the project # Enable timesheets by +checking *Timesheets* # Make task selection mandatory by checking +*Require Tasks on Timesheets* + +Default setting can be changed at company level: + +# Go to *Project > Configuration > Settings* # Make task selection +mandatory for new projects by checking *Require Tasks on Timesheets* + +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 +------- + +* ACSONE SA/NV +* CorporateHub + +Contributors +------------ + +- Adrien Peiffer +- Laurent Mignon +- Benjamin Willig +- `CorporateHub `__ + + - Alexey Pelykh + +- Saran Lim. +- Foram Shah +- Houssine Bakkali +- `Heliconia Solutions Pvt. Ltd. `__ + + - Bhavesh Heliconia + +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_required/__init__.py b/hr_timesheet_task_required/__init__.py new file mode 100644 index 0000000000..31660d6a96 --- /dev/null +++ b/hr_timesheet_task_required/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import models diff --git a/hr_timesheet_task_required/__manifest__.py b/hr_timesheet_task_required/__manifest__.py new file mode 100644 index 0000000000..fd620c4502 --- /dev/null +++ b/hr_timesheet_task_required/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2016-2017 ACSONE SA/NV +# Copyright 2018-2019 Brainbean Apps (https://brainbeanapps.com) +# Copyright 2020 CorporateHub (https://corporatehub.eu) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Hr Timesheet Task Required", + "summary": """ + Set task on timesheet as a mandatory field""", + "version": "18.0.1.0.0", + "license": "AGPL-3", + "author": "ACSONE SA/NV, CorporateHub, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/timesheet", + "depends": ["hr_timesheet"], + "data": [ + "views/account_analytic_line.xml", + "views/project_project.xml", + "views/res_config_settings.xml", + ], +} diff --git a/hr_timesheet_task_required/i18n/de.po b/hr_timesheet_task_required/i18n/de.po new file mode 100644 index 0000000000..80b3917aa3 --- /dev/null +++ b/hr_timesheet_task_required/i18n/de.po @@ -0,0 +1,77 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_timesheet_task_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-07-12 13: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_required +#: model:ir.model,name:hr_timesheet_task_required.model_account_analytic_line +msgid "Analytic Line" +msgstr "Kostenstellenbuchung" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_res_company +msgid "Companies" +msgstr "Unternehmen" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_res_config_settings +msgid "Config Settings" +msgstr "Konfigurationseinstellungen" + +#. module: hr_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_account_analytic_line__is_task_required +msgid "Is Task Required" +msgstr "Aufgabe ist obligatorisch" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_project_project +msgid "Project" +msgstr "Projekt" + +#. module: hr_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_project_project__is_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_res_company__is_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_res_config_settings__is_timesheet_task_required +msgid "Require Tasks on Timesheets" +msgstr "Aufgaben bei Zeiterfassung obligatorisch" + +#. module: hr_timesheet_task_required +#: model_terms:ir.ui.view,arch_db:hr_timesheet_task_required.res_config_settings_view_form +msgid "Require task selection on each timesheet entry by default" +msgstr "" +"Wenn der Haken gesetzt ist, muss bei der Zeiterfassung eine Aufgabe " +"eingetragen werden." + +#. module: hr_timesheet_task_required +#: model_terms:ir.ui.view,arch_db:hr_timesheet_task_required.project_invoice_form +msgid "Set tasks on timesheet as a mandatory field" +msgstr "" + +#. module: hr_timesheet_task_required +#. odoo-python +#: code:addons/hr_timesheet_task_required/models/account_analytic_line.py:0 +#, python-format +msgid "You must specify a task for timesheet lines." +msgstr "F??r Zeiterfassungen muss eine Aufgabe eingetragen werden." + +#~ msgid "" +#~ "" +#~ msgstr "" +#~ "" diff --git a/hr_timesheet_task_required/i18n/es.po b/hr_timesheet_task_required/i18n/es.po new file mode 100644 index 0000000000..3822430247 --- /dev/null +++ b/hr_timesheet_task_required/i18n/es.po @@ -0,0 +1,86 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_timesheet_task_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.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_required +#: model:ir.model,name:hr_timesheet_task_required.model_account_analytic_line +msgid "Analytic Line" +msgstr "L??nea de cuenta anal??tica" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_res_company +msgid "Companies" +msgstr "Empresas" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_res_config_settings +msgid "Config Settings" +msgstr "Par??metros de configuraci??n" + +#. module: hr_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_account_analytic_line__is_task_required +msgid "Is Task Required" +msgstr "La tarea es requerida" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_project_project +msgid "Project" +msgstr "Proyecto" + +#. module: hr_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_project_project__is_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_res_company__is_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_res_config_settings__is_timesheet_task_required +msgid "Require Tasks on Timesheets" +msgstr "Requiere tarea en partes de horas" + +#. module: hr_timesheet_task_required +#: model_terms:ir.ui.view,arch_db:hr_timesheet_task_required.res_config_settings_view_form +msgid "Require task selection on each timesheet entry by default" +msgstr "" +"Requiere por defecto selecci??n de tarea en cada entrada de partes de horas" + +#. module: hr_timesheet_task_required +#: model_terms:ir.ui.view,arch_db:hr_timesheet_task_required.project_invoice_form +msgid "Set tasks on timesheet as a mandatory field" +msgstr "Establecer tareas en la hoja de horas como campo obligatorio" + +#. module: hr_timesheet_task_required +#. odoo-python +#: code:addons/hr_timesheet_task_required/models/account_analytic_line.py:0 +#, python-format +msgid "You must specify a task for timesheet lines." +msgstr "Se debe especificar una tarea para los partes de horas." + +#~ msgid "" +#~ "" +#~ msgstr "" +#~ "" + +#~ msgid "Display Name" +#~ msgstr "Nombre a mostrar" + +#~ msgid "ID" +#~ msgstr "Id." + +#~ msgid "Last Modified on" +#~ msgstr "??lt. modif. en" diff --git a/hr_timesheet_task_required/i18n/fr.po b/hr_timesheet_task_required/i18n/fr.po new file mode 100644 index 0000000000..01f215ef00 --- /dev/null +++ b/hr_timesheet_task_required/i18n/fr.po @@ -0,0 +1,89 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_timesheet_task_required +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-02 02:56+0000\n" +"PO-Revision-Date: 2022-10-05 15:29+0000\n" +"Last-Translator: Vincent Hatakeyama \n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\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_required +#: model:ir.model,name:hr_timesheet_task_required.model_account_analytic_line +msgid "Analytic Line" +msgstr "Ligne analytique" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_res_company +msgid "Companies" +msgstr "Sociétés" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_res_config_settings +msgid "Config Settings" +msgstr "Paramètres de configuration" + +#. module: hr_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_account_analytic_line__is_task_required +msgid "Is Task Required" +msgstr "Tâche exigé" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_project_project +msgid "Project" +msgstr "Projet" + +#. module: hr_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_project_project__is_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_res_company__is_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_res_config_settings__is_timesheet_task_required +msgid "Require Tasks on Timesheets" +msgstr "Exiger des tâches sur les feuilles de temps" + +#. module: hr_timesheet_task_required +#: model_terms:ir.ui.view,arch_db:hr_timesheet_task_required.res_config_settings_view_form +msgid "Require task selection on each timesheet entry by default" +msgstr "" +"Exiger par défaut la sélection des tâches sur chaque entrée de feuille de " +"temps" + +#. module: hr_timesheet_task_required +#: model_terms:ir.ui.view,arch_db:hr_timesheet_task_required.project_invoice_form +msgid "Set tasks on timesheet as a mandatory field" +msgstr "" + +#. module: hr_timesheet_task_required +#. odoo-python +#: code:addons/hr_timesheet_task_required/models/account_analytic_line.py:0 +#, python-format +msgid "You must specify a task for timesheet lines." +msgstr "Vous devez spécifier une tâche pour les lignes de feuilles de temps." + +#~ msgid "" +#~ "" +#~ msgstr "" +#~ "" + +#~ msgid "Display Name" +#~ msgstr "Nom affiché" + +#~ msgid "ID" +#~ msgstr "Id." + +#~ msgid "Last Modified on" +#~ msgstr "Dernière modification le" diff --git a/hr_timesheet_task_required/i18n/fr_FR.po b/hr_timesheet_task_required/i18n/fr_FR.po new file mode 100644 index 0000000000..843edbdbc1 --- /dev/null +++ b/hr_timesheet_task_required/i18n/fr_FR.po @@ -0,0 +1,68 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_timesheet_task_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-04-11 18:46+0000\n" +"Last-Translator: Yves Le Doeuff \n" +"Language-Team: none\n" +"Language: fr_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_required +#: model:ir.model,name:hr_timesheet_task_required.model_account_analytic_line +msgid "Analytic Line" +msgstr "Ligne analytique" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_res_company +msgid "Companies" +msgstr "Soci??t??s" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: hr_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_account_analytic_line__is_task_required +msgid "Is Task Required" +msgstr "Exiger une t??che" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_project_project +msgid "Project" +msgstr "Projet" + +#. module: hr_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_project_project__is_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_res_company__is_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_res_config_settings__is_timesheet_task_required +msgid "Require Tasks on Timesheets" +msgstr "Exiger des t??ches sur les feuilles de temps" + +#. module: hr_timesheet_task_required +#: model_terms:ir.ui.view,arch_db:hr_timesheet_task_required.res_config_settings_view_form +msgid "Require task selection on each timesheet entry by default" +msgstr "" +"Exiger par d??faut la s??lection des t??ches sur chaque entr??e de feuille " +"de temps" + +#. module: hr_timesheet_task_required +#: model_terms:ir.ui.view,arch_db:hr_timesheet_task_required.project_invoice_form +msgid "Set tasks on timesheet as a mandatory field" +msgstr "" + +#. module: hr_timesheet_task_required +#. odoo-python +#: code:addons/hr_timesheet_task_required/models/account_analytic_line.py:0 +#, python-format +msgid "You must specify a task for timesheet lines." +msgstr "Vous devez sp??cifier une t??che pour les lignes de feuilles de temps." diff --git a/hr_timesheet_task_required/i18n/hr_timesheet_task_required.pot b/hr_timesheet_task_required/i18n/hr_timesheet_task_required.pot new file mode 100644 index 0000000000..dccabbfeb1 --- /dev/null +++ b/hr_timesheet_task_required/i18n/hr_timesheet_task_required.pot @@ -0,0 +1,63 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_timesheet_task_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.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_required +#: model:ir.model,name:hr_timesheet_task_required.model_account_analytic_line +msgid "Analytic Line" +msgstr "" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_res_company +msgid "Companies" +msgstr "" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: hr_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_account_analytic_line__is_task_required +msgid "Is Task Required" +msgstr "" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_project_project +msgid "Project" +msgstr "" + +#. module: hr_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_project_project__is_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_res_company__is_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_res_config_settings__is_timesheet_task_required +msgid "Require Tasks on Timesheets" +msgstr "" + +#. module: hr_timesheet_task_required +#: model_terms:ir.ui.view,arch_db:hr_timesheet_task_required.res_config_settings_view_form +msgid "Require task selection on each timesheet entry by default" +msgstr "" + +#. module: hr_timesheet_task_required +#: model_terms:ir.ui.view,arch_db:hr_timesheet_task_required.project_invoice_form +msgid "Set tasks on timesheet as a mandatory field" +msgstr "" + +#. module: hr_timesheet_task_required +#. odoo-python +#: code:addons/hr_timesheet_task_required/models/account_analytic_line.py:0 +#, python-format +msgid "You must specify a task for timesheet lines." +msgstr "" diff --git a/hr_timesheet_task_required/i18n/it.po b/hr_timesheet_task_required/i18n/it.po new file mode 100644 index 0000000000..01b1db17e3 --- /dev/null +++ b/hr_timesheet_task_required/i18n/it.po @@ -0,0 +1,78 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_timesheet_task_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-05-25 12:12+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_required +#: model:ir.model,name:hr_timesheet_task_required.model_account_analytic_line +msgid "Analytic Line" +msgstr "Riga analitica" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_res_company +msgid "Companies" +msgstr "Aziende" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_res_config_settings +msgid "Config Settings" +msgstr "Impostazioni configurazione" + +#. module: hr_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_account_analytic_line__is_task_required +msgid "Is Task Required" +msgstr "Il lavoro è richiesto" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_project_project +msgid "Project" +msgstr "Progetto" + +#. module: hr_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_project_project__is_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_res_company__is_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_res_config_settings__is_timesheet_task_required +msgid "Require Tasks on Timesheets" +msgstr "Richiede i lavori sui fogli ore" + +#. module: hr_timesheet_task_required +#: model_terms:ir.ui.view,arch_db:hr_timesheet_task_required.res_config_settings_view_form +msgid "Require task selection on each timesheet entry by default" +msgstr "" +"Richiede in modo predefinito la selezione del lavoro per ogni registrazione " +"nel foglio ore" + +#. module: hr_timesheet_task_required +#: model_terms:ir.ui.view,arch_db:hr_timesheet_task_required.project_invoice_form +msgid "Set tasks on timesheet as a mandatory field" +msgstr "Imposta il lavoro sul fogli ore come campo obbligatorio" + +#. module: hr_timesheet_task_required +#. odoo-python +#: code:addons/hr_timesheet_task_required/models/account_analytic_line.py:0 +#, python-format +msgid "You must specify a task for timesheet lines." +msgstr "Bisogna indicare un lavoro per le righe del fogli ore." + +#~ msgid "" +#~ "" +#~ msgstr "" +#~ "" diff --git a/hr_timesheet_task_required/i18n/nl.po b/hr_timesheet_task_required/i18n/nl.po new file mode 100644 index 0000000000..cd5f580f8b --- /dev/null +++ b/hr_timesheet_task_required/i18n/nl.po @@ -0,0 +1,64 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_timesheet_task_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: nl\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" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_account_analytic_line +msgid "Analytic Line" +msgstr "" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_res_company +msgid "Companies" +msgstr "" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: hr_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_account_analytic_line__is_task_required +msgid "Is Task Required" +msgstr "" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_project_project +msgid "Project" +msgstr "" + +#. module: hr_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_project_project__is_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_res_company__is_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_res_config_settings__is_timesheet_task_required +msgid "Require Tasks on Timesheets" +msgstr "" + +#. module: hr_timesheet_task_required +#: model_terms:ir.ui.view,arch_db:hr_timesheet_task_required.res_config_settings_view_form +msgid "Require task selection on each timesheet entry by default" +msgstr "" + +#. module: hr_timesheet_task_required +#: model_terms:ir.ui.view,arch_db:hr_timesheet_task_required.project_invoice_form +msgid "Set tasks on timesheet as a mandatory field" +msgstr "" + +#. module: hr_timesheet_task_required +#. odoo-python +#: code:addons/hr_timesheet_task_required/models/account_analytic_line.py:0 +#, python-format +msgid "You must specify a task for timesheet lines." +msgstr "" diff --git a/hr_timesheet_task_required/i18n/nl_NL.po b/hr_timesheet_task_required/i18n/nl_NL.po new file mode 100644 index 0000000000..5cd9244af4 --- /dev/null +++ b/hr_timesheet_task_required/i18n/nl_NL.po @@ -0,0 +1,75 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_timesheet_task_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-04-18 18:46+0000\n" +"Last-Translator: Bosd \n" +"Language-Team: none\n" +"Language: nl_NL\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_required +#: model:ir.model,name:hr_timesheet_task_required.model_account_analytic_line +msgid "Analytic Line" +msgstr "Kostenplaatsregel" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_res_company +msgid "Companies" +msgstr "Bedrijven" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_res_config_settings +msgid "Config Settings" +msgstr "Configuratie instellingen" + +#. module: hr_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_account_analytic_line__is_task_required +msgid "Is Task Required" +msgstr "Is taak verplicht" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_project_project +msgid "Project" +msgstr "Project" + +#. module: hr_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_project_project__is_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_res_company__is_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_res_config_settings__is_timesheet_task_required +msgid "Require Tasks on Timesheets" +msgstr "Maak taak verplicht op urenstaten" + +#. module: hr_timesheet_task_required +#: model_terms:ir.ui.view,arch_db:hr_timesheet_task_required.res_config_settings_view_form +msgid "Require task selection on each timesheet entry by default" +msgstr "Maak standaard taak verplicht op elke urenstaat regel" + +#. module: hr_timesheet_task_required +#: model_terms:ir.ui.view,arch_db:hr_timesheet_task_required.project_invoice_form +msgid "Set tasks on timesheet as a mandatory field" +msgstr "" + +#. module: hr_timesheet_task_required +#. odoo-python +#: code:addons/hr_timesheet_task_required/models/account_analytic_line.py:0 +#, python-format +msgid "You must specify a task for timesheet lines." +msgstr "U moet een taak specificeren voor de urenstaat regels." + +#~ msgid "" +#~ "" +#~ msgstr "" +#~ "" diff --git a/hr_timesheet_task_required/i18n/pt_BR.po b/hr_timesheet_task_required/i18n/pt_BR.po new file mode 100644 index 0000000000..49874efd20 --- /dev/null +++ b/hr_timesheet_task_required/i18n/pt_BR.po @@ -0,0 +1,77 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_timesheet_task_required +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-10-29 08:28+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_required +#: model:ir.model,name:hr_timesheet_task_required.model_account_analytic_line +msgid "Analytic Line" +msgstr "Linha Analítica" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_res_company +msgid "Companies" +msgstr "Empresas" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_res_config_settings +msgid "Config Settings" +msgstr "Configuração" + +#. module: hr_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_account_analytic_line__is_task_required +msgid "Is Task Required" +msgstr "A tarefa é Requerida" + +#. module: hr_timesheet_task_required +#: model:ir.model,name:hr_timesheet_task_required.model_project_project +msgid "Project" +msgstr "Projeto" + +#. module: hr_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_project_project__is_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_res_company__is_timesheet_task_required +#: model:ir.model.fields,field_description:hr_timesheet_task_required.field_res_config_settings__is_timesheet_task_required +msgid "Require Tasks on Timesheets" +msgstr "Exigir tarefas em planilhas de horas" + +#. module: hr_timesheet_task_required +#: model_terms:ir.ui.view,arch_db:hr_timesheet_task_required.res_config_settings_view_form +msgid "Require task selection on each timesheet entry by default" +msgstr "" +"Exigir seleção de tarefas em cada entrada do Apontamentos de horas por padrão" + +#. module: hr_timesheet_task_required +#: model_terms:ir.ui.view,arch_db:hr_timesheet_task_required.project_invoice_form +msgid "Set tasks on timesheet as a mandatory field" +msgstr "Definir tarefas no apontamento de horas como campo obrigatório" + +#. module: hr_timesheet_task_required +#. odoo-python +#: code:addons/hr_timesheet_task_required/models/account_analytic_line.py:0 +#, python-format +msgid "You must specify a task for timesheet lines." +msgstr "Você deve especificar uma tarefa para linhas da planilha de horas." + +#~ msgid "" +#~ "" +#~ msgstr "" +#~ "" diff --git a/hr_timesheet_task_required/models/__init__.py b/hr_timesheet_task_required/models/__init__.py new file mode 100644 index 0000000000..115518d60d --- /dev/null +++ b/hr_timesheet_task_required/models/__init__.py @@ -0,0 +1,6 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import res_company +from . import project_project +from . import account_analytic_line +from . import res_config_settings diff --git a/hr_timesheet_task_required/models/account_analytic_line.py b/hr_timesheet_task_required/models/account_analytic_line.py new file mode 100644 index 0000000000..f93ece12d1 --- /dev/null +++ b/hr_timesheet_task_required/models/account_analytic_line.py @@ -0,0 +1,20 @@ +# Copyright 2018 ACSONE SA/NV +# Copyright 2018-2019 Brainbean Apps (https://brainbeanapps.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models +from odoo.exceptions import ValidationError + + +class AccountAnalyticLine(models.Model): + _inherit = "account.analytic.line" + + is_task_required = fields.Boolean(related="project_id.is_timesheet_task_required") + + @api.constrains("project_id", "task_id") + def _check_timesheet_task(self): + for line in self: + if line.is_task_required and not line.task_id: + raise ValidationError( + self.env._("You must specify a task for timesheet lines.") + ) diff --git a/hr_timesheet_task_required/models/project_project.py b/hr_timesheet_task_required/models/project_project.py new file mode 100644 index 0000000000..4b2e1cc100 --- /dev/null +++ b/hr_timesheet_task_required/models/project_project.py @@ -0,0 +1,20 @@ +# Copyright 2018-2019 Brainbean Apps (https://brainbeanapps.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class ProjectProject(models.Model): + _inherit = "project.project" + + is_timesheet_task_required = fields.Boolean( + string="Require Tasks on Timesheets", + default=lambda self: self._default_is_timesheet_task_required(), + ) + + @api.model + def _default_is_timesheet_task_required(self): + company = self.env["res.company"].browse( + self._context.get("company_id", self.env.user.company_id.id) + ) + return company.is_timesheet_task_required diff --git a/hr_timesheet_task_required/models/res_company.py b/hr_timesheet_task_required/models/res_company.py new file mode 100644 index 0000000000..fd94efec24 --- /dev/null +++ b/hr_timesheet_task_required/models/res_company.py @@ -0,0 +1,10 @@ +# Copyright 2018-2019 Brainbean Apps (https://brainbeanapps.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ResCompany(models.Model): + _inherit = "res.company" + + is_timesheet_task_required = fields.Boolean(string="Require Tasks on Timesheets") diff --git a/hr_timesheet_task_required/models/res_config_settings.py b/hr_timesheet_task_required/models/res_config_settings.py new file mode 100644 index 0000000000..83b6689711 --- /dev/null +++ b/hr_timesheet_task_required/models/res_config_settings.py @@ -0,0 +1,14 @@ +# Copyright 2018-2019 Brainbean Apps (https://brainbeanapps.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + _inherit = "res.config.settings" + + is_timesheet_task_required = fields.Boolean( + string="Require Tasks on Timesheets", + related="company_id.is_timesheet_task_required", + readonly=False, + ) diff --git a/hr_timesheet_task_required/pyproject.toml b/hr_timesheet_task_required/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/hr_timesheet_task_required/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/hr_timesheet_task_required/readme/CONFIGURE.md b/hr_timesheet_task_required/readme/CONFIGURE.md new file mode 100644 index 0000000000..9048c12d3a --- /dev/null +++ b/hr_timesheet_task_required/readme/CONFIGURE.md @@ -0,0 +1,10 @@ +To make task selection mandatory on project's timesheets: + +\# Go to *Project \> Projects* and edit the project \# Enable timesheets +by checking *Timesheets* \# Make task selection mandatory by checking +*Require Tasks on Timesheets* + +Default setting can be changed at company level: + +\# Go to *Project \> Configuration \> Settings* \# Make task selection +mandatory for new projects by checking *Require Tasks on Timesheets* diff --git a/hr_timesheet_task_required/readme/CONTRIBUTORS.md b/hr_timesheet_task_required/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..3c05165f08 --- /dev/null +++ b/hr_timesheet_task_required/readme/CONTRIBUTORS.md @@ -0,0 +1,11 @@ +- Adrien Peiffer \<\> +- Laurent Mignon \<\> +- Benjamin Willig \<\> +- [CorporateHub](https://corporatehub.eu/) + - Alexey Pelykh \<\> +- Saran Lim. \<\> +- Foram Shah \<\> +- Houssine Bakkali \<\> +- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io) + - Bhavesh Heliconia + diff --git a/hr_timesheet_task_required/readme/DESCRIPTION.md b/hr_timesheet_task_required/readme/DESCRIPTION.md new file mode 100644 index 0000000000..9028ba19c8 --- /dev/null +++ b/hr_timesheet_task_required/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module allows to configure project as having task on timesheet as a +mandatory field. diff --git a/hr_timesheet_task_required/static/description/icon.png b/hr_timesheet_task_required/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/hr_timesheet_task_required/static/description/icon.png differ diff --git a/hr_timesheet_task_required/static/description/index.html b/hr_timesheet_task_required/static/description/index.html new file mode 100644 index 0000000000..f7beefb583 --- /dev/null +++ b/hr_timesheet_task_required/static/description/index.html @@ -0,0 +1,449 @@ + + + + + +Hr Timesheet Task Required + + + +
+

Hr Timesheet Task Required

+ + +

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

+

This module allows to configure project as having task on timesheet as a +mandatory field.

+

Table of contents

+ +
+

Configuration

+

To make task selection mandatory on project’s timesheets:

+

# Go to Project > Projects and edit the project # Enable timesheets by +checking Timesheets # Make task selection mandatory by checking +Require Tasks on Timesheets

+

Default setting can be changed at company level:

+

# Go to Project > Configuration > Settings # Make task selection +mandatory for new projects by checking Require Tasks on Timesheets

+
+
+

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

+
    +
  • ACSONE SA/NV
  • +
  • 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.

+
+
+
+ + diff --git a/hr_timesheet_task_required/tests/__init__.py b/hr_timesheet_task_required/tests/__init__.py new file mode 100644 index 0000000000..04a7009843 --- /dev/null +++ b/hr_timesheet_task_required/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import test_hr_timesheet_task_required diff --git a/hr_timesheet_task_required/tests/test_hr_timesheet_task_required.py b/hr_timesheet_task_required/tests/test_hr_timesheet_task_required.py new file mode 100644 index 0000000000..d6c5641c1a --- /dev/null +++ b/hr_timesheet_task_required/tests/test_hr_timesheet_task_required.py @@ -0,0 +1,77 @@ +# Copyright 2018 ACSONE SA/NV +# Copyright 2018-2019 Brainbean Apps (https://brainbeanapps.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.exceptions import ValidationError +from odoo.tests import TransactionCase + + +class TestHrTimesheetTaskRequired(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + + cls.AnalyticLine = cls.env["account.analytic.line"] + cls.Project = cls.env["project.project"] + cls.ProjectTask = cls.env["project.task"] + cls.Employee = cls.env["hr.employee"] + + cls.project_1 = cls.Project.create( + {"name": "Project 1", "is_timesheet_task_required": True} + ) + cls.project_2 = cls.Project.create({"name": "Project 2"}) + cls.task_1_p1 = cls.ProjectTask.create( + {"name": "Task 1-1", "project_id": cls.project_1.id} + ) + cls.task_1_p2 = cls.ProjectTask.create( + {"name": "Task 2-1", "project_id": cls.project_2.id} + ) + cls.employee = cls.Employee.create({"name": "Employee 1"}) + + def test_timesheet_line_task_required(self): + with self.assertRaises(ValidationError): + self.AnalyticLine.create( + { + "name": "test", + "project_id": self.project_1.id, + "unit_amount": 10, + "employee_id": self.employee.id, + } + ) + + self.AnalyticLine.create( + { + "name": "test", + "project_id": self.project_1.id, + "task_id": self.task_1_p1.id, + "unit_amount": 10, + "employee_id": self.employee.id, + } + ) + + def test_timesheet_line_task_not_required(self): + # Project with task not required + self.assertFalse(self.project_2.is_timesheet_task_required) + + # Create a timesheet line without a task + timesheet_line = self.AnalyticLine.create( + { + "name": "test", + "project_id": self.project_2.id, + "unit_amount": 10, + "employee_id": self.employee.id, + } + ) + self.assertTrue(timesheet_line) + + # Create a timesheet line with a task + timesheet_line_with_task = self.AnalyticLine.create( + { + "name": "test", + "project_id": self.project_2.id, + "task_id": self.task_1_p2.id, + "unit_amount": 10, + "employee_id": self.employee.id, + } + ) + self.assertTrue(timesheet_line_with_task) diff --git a/hr_timesheet_task_required/views/account_analytic_line.xml b/hr_timesheet_task_required/views/account_analytic_line.xml new file mode 100644 index 0000000000..5107b7a696 --- /dev/null +++ b/hr_timesheet_task_required/views/account_analytic_line.xml @@ -0,0 +1,28 @@ + + + + + account.analytic.line.view.form + account.analytic.line + + + + is_task_required + + + + + account.analytic.line.view.tree + account.analytic.line + + + + is_task_required + + + + diff --git a/hr_timesheet_task_required/views/project_project.xml b/hr_timesheet_task_required/views/project_project.xml new file mode 100644 index 0000000000..8fe39f81b6 --- /dev/null +++ b/hr_timesheet_task_required/views/project_project.xml @@ -0,0 +1,40 @@ + + + + + project.project.view.form.simplified + project.project + + + + + + + + + project.project.view.form + project.project + + + + + + + + + + + diff --git a/hr_timesheet_task_required/views/res_config_settings.xml b/hr_timesheet_task_required/views/res_config_settings.xml new file mode 100644 index 0000000000..39d07284a4 --- /dev/null +++ b/hr_timesheet_task_required/views/res_config_settings.xml @@ -0,0 +1,22 @@ + + + + + res.config.settings.view.form + res.config.settings + + + + + + + + + +