diff --git a/crm_timesheet/README.rst b/crm_timesheet/README.rst new file mode 100644 index 0000000000..2b77ab4638 --- /dev/null +++ b/crm_timesheet/README.rst @@ -0,0 +1,111 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +============= +CRM Timesheet +============= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:ce17327f1c679c48ee3e0e77909a88efa1f4d21c3ad7ce5c05b25d119a08ef36 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-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/19.0/crm_timesheet + :alt: OCA/timesheet +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/timesheet-19-0/timesheet-19-0-crm_timesheet + :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=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to generate timesheets from leads/opportunities. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +- In pipeline/lead forms you have Timesheet tab. + +Known issues / Roadmap +====================== + +- Window actions crm.crm_lead_all_leads and + crm.crm_lead_opportunities_tree_view contexts are overwritten for + hiding the lead field in timesheet embedded view. As this is not + accumulative, this change might be lost by other module overwritting + the same action, or this masks another module overwritting. + +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 + +Contributors +------------ + +- `Tecnativa `__ + + - Antonio Espinosa + - Rafael Blasco + - Javier Iniesta + - David Vidal + - Vicent Cubells + - Jairo Llopis + - Carolina Fernandez + - Víctor Martínez + +- Foram Shah + +- `Sygel `__ + + - Harald Panten + - Valentin Vinagre + - Roger Sans + +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/crm_timesheet/__init__.py b/crm_timesheet/__init__.py new file mode 100644 index 0000000000..aee8895e7a --- /dev/null +++ b/crm_timesheet/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import wizards diff --git a/crm_timesheet/__manifest__.py b/crm_timesheet/__manifest__.py new file mode 100644 index 0000000000..bdfae07499 --- /dev/null +++ b/crm_timesheet/__manifest__.py @@ -0,0 +1,23 @@ +# Copyright 2015 Antiun - Antonio Espinosa +# Copyright 2015 Antiun - Javier Iniesta +# Copyright 2017 Tecnativa - David Vidal +# Copyright 2019 Tecnativa - Jairo Llopis +# Copyright 2020 Tecnativa - Pedro M. Baeza +# Copyright 2023 Tecnativa - Carolina Fernandez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "CRM Timesheet", + "category": "Customer Relationship Management", + "version": "19.0.1.0.0", + "depends": ["crm", "project_timesheet_time_control"], + "data": [ + "security/ir.model.access.csv", + "views/crm_lead_view.xml", + "views/hr_timesheet_view.xml", + ], + "author": "Tecnativa, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/timesheet", + "license": "AGPL-3", + "installable": True, +} diff --git a/crm_timesheet/i18n/crm_timesheet.pot b/crm_timesheet/i18n/crm_timesheet.pot new file mode 100644 index 0000000000..a88c1118e2 --- /dev/null +++ b/crm_timesheet/i18n/crm_timesheet.pot @@ -0,0 +1,81 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_timesheet +# +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: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "" +msgstr "" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_account_analytic_line +msgid "Analytic Line" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_hr_timesheet_switch +msgid "Helper to quickly switch between timesheet lines" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model.fields,help:crm_timesheet.field_crm_lead__show_time_control +msgid "Indicate which time control button to show, if any." +msgstr "" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_crm_lead +#: model:ir.model.fields,field_description:crm_timesheet.field_account_analytic_line__lead_id +msgid "Lead/Opportunity" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__project_id +msgid "Project" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__show_time_control +msgid "Show Time Control" +msgstr "" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_oppor +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "Start work" +msgstr "" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_oppor +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "Stop work" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__timesheet_ids +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +msgid "Timesheet" +msgstr "" diff --git a/crm_timesheet/i18n/cs_CZ.po b/crm_timesheet/i18n/cs_CZ.po new file mode 100644 index 0000000000..c847a2b65f --- /dev/null +++ b/crm_timesheet/i18n/cs_CZ.po @@ -0,0 +1,87 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_timesheet +# +# Translators: +# Lukáš Spurný , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-23 01:55+0000\n" +"PO-Revision-Date: 2018-02-23 01:55+0000\n" +"Last-Translator: Lukáš Spurný , 2018\n" +"Language-Team: Czech (Czech Republic) (https://www.transifex.com/oca/" +"teams/23907/cs_CZ/)\n" +"Language: cs_CZ\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "" +msgstr "" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_account_analytic_line +msgid "Analytic Line" +msgstr "Analytická linka" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_hr_timesheet_switch +msgid "Helper to quickly switch between timesheet lines" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model.fields,help:crm_timesheet.field_crm_lead__show_time_control +msgid "Indicate which time control button to show, if any." +msgstr "" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_crm_lead +#: model:ir.model.fields,field_description:crm_timesheet.field_account_analytic_line__lead_id +msgid "Lead/Opportunity" +msgstr "Vedoucí/příležitost" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__project_id +msgid "Project" +msgstr "Projekt" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__show_time_control +msgid "Show Time Control" +msgstr "" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_oppor +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "Start work" +msgstr "" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_oppor +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "Stop work" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__timesheet_ids +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +msgid "Timesheet" +msgstr "Rozvrh hodin" diff --git a/crm_timesheet/i18n/de.po b/crm_timesheet/i18n/de.po new file mode 100644 index 0000000000..92d5e7efdf --- /dev/null +++ b/crm_timesheet/i18n/de.po @@ -0,0 +1,84 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_timesheet +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.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: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "" +msgstr "" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_account_analytic_line +msgid "Analytic Line" +msgstr "Kostenstellenbuchung" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_hr_timesheet_switch +msgid "Helper to quickly switch between timesheet lines" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model.fields,help:crm_timesheet.field_crm_lead__show_time_control +msgid "Indicate which time control button to show, if any." +msgstr "" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_crm_lead +#: model:ir.model.fields,field_description:crm_timesheet.field_account_analytic_line__lead_id +msgid "Lead/Opportunity" +msgstr "Interessent / Chance" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__project_id +msgid "Project" +msgstr "Projekt" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__show_time_control +msgid "Show Time Control" +msgstr "" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_oppor +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "Start work" +msgstr "" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_oppor +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "Stop work" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__timesheet_ids +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +msgid "Timesheet" +msgstr "Zeiterfassung" diff --git a/crm_timesheet/i18n/es.po b/crm_timesheet/i18n/es.po new file mode 100644 index 0000000000..8856e46262 --- /dev/null +++ b/crm_timesheet/i18n/es.po @@ -0,0 +1,88 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_timesheet +# +# Translators: +# OCA Transbot , 2018 +# enjolras , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-03 05:20+0000\n" +"PO-Revision-Date: 2023-10-15 20:38+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\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: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "" +msgstr "" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_account_analytic_line +msgid "Analytic Line" +msgstr "Línea analítica" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_hr_timesheet_switch +msgid "Helper to quickly switch between timesheet lines" +msgstr "Asistente para cambiar entre lineas de partes de horas" + +#. module: crm_timesheet +#: model:ir.model.fields,help:crm_timesheet.field_crm_lead__show_time_control +msgid "Indicate which time control button to show, if any." +msgstr "Indicar qué botón de control horario mostrar, si lo hay." + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_crm_lead +#: model:ir.model.fields,field_description:crm_timesheet.field_account_analytic_line__lead_id +msgid "Lead/Opportunity" +msgstr "Iniciativa/Oportunidad" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__project_id +msgid "Project" +msgstr "Proyecto" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__show_time_control +msgid "Show Time Control" +msgstr "Mostrar Control de Tiempo" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_oppor +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "Start work" +msgstr "Iniciar tarea" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_oppor +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "Stop work" +msgstr "Detener tarea" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__timesheet_ids +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +msgid "Timesheet" +msgstr "Parte de horas" diff --git a/crm_timesheet/i18n/fr.po b/crm_timesheet/i18n/fr.po new file mode 100644 index 0000000000..b242244837 --- /dev/null +++ b/crm_timesheet/i18n/fr.po @@ -0,0 +1,86 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_timesheet +# +# Translators: +# Quentin THEURET , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-18 00:44+0000\n" +"PO-Revision-Date: 2017-08-18 00:44+0000\n" +"Last-Translator: Quentin THEURET , 2017\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" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "" +msgstr "" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_account_analytic_line +msgid "Analytic Line" +msgstr "Ligne analytique" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_hr_timesheet_switch +msgid "Helper to quickly switch between timesheet lines" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model.fields,help:crm_timesheet.field_crm_lead__show_time_control +msgid "Indicate which time control button to show, if any." +msgstr "" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_crm_lead +#: model:ir.model.fields,field_description:crm_timesheet.field_account_analytic_line__lead_id +msgid "Lead/Opportunity" +msgstr "Piste/Opportunité" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__project_id +msgid "Project" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__show_time_control +msgid "Show Time Control" +msgstr "" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_oppor +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "Start work" +msgstr "" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_oppor +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "Stop work" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__timesheet_ids +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +msgid "Timesheet" +msgstr "Feuille de temps" diff --git a/crm_timesheet/i18n/it.po b/crm_timesheet/i18n/it.po new file mode 100644 index 0000000000..1c46a2f6cc --- /dev/null +++ b/crm_timesheet/i18n/it.po @@ -0,0 +1,87 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_timesheet +# +# Translators: +# Marco Calcagni , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-31 04:45+0000\n" +"PO-Revision-Date: 2023-10-13 16:38+0000\n" +"Last-Translator: mymage \n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\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: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "" +msgstr "" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_account_analytic_line +msgid "Analytic Line" +msgstr "Riga analitica" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_hr_timesheet_switch +msgid "Helper to quickly switch between timesheet lines" +msgstr "Assistente per spostarsi velocemente tra righe del foglio ore" + +#. module: crm_timesheet +#: model:ir.model.fields,help:crm_timesheet.field_crm_lead__show_time_control +msgid "Indicate which time control button to show, if any." +msgstr "Indica se e quale pulsante di controllo tempo visualizzare." + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_crm_lead +#: model:ir.model.fields,field_description:crm_timesheet.field_account_analytic_line__lead_id +msgid "Lead/Opportunity" +msgstr "Contatto/Opportunità" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__project_id +msgid "Project" +msgstr "Progetto" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__show_time_control +msgid "Show Time Control" +msgstr "Visualizza controllo orario" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_oppor +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "Start work" +msgstr "Avvia lavoro" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_oppor +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "Stop work" +msgstr "Termine lavoro" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__timesheet_ids +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +msgid "Timesheet" +msgstr "Foglio ore" diff --git a/crm_timesheet/i18n/nl.po b/crm_timesheet/i18n/nl.po new file mode 100644 index 0000000000..aba1d305c0 --- /dev/null +++ b/crm_timesheet/i18n/nl.po @@ -0,0 +1,84 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_timesheet +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-12-13 03:55+0000\n" +"Last-Translator: Bosd \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" +"X-Generator: Weblate 3.10\n" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "" +msgstr "" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_account_analytic_line +msgid "Analytic Line" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_hr_timesheet_switch +msgid "Helper to quickly switch between timesheet lines" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model.fields,help:crm_timesheet.field_crm_lead__show_time_control +msgid "Indicate which time control button to show, if any." +msgstr "" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_crm_lead +#: model:ir.model.fields,field_description:crm_timesheet.field_account_analytic_line__lead_id +msgid "Lead/Opportunity" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__project_id +msgid "Project" +msgstr "Project" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__show_time_control +msgid "Show Time Control" +msgstr "" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_oppor +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "Start work" +msgstr "Start Tijd" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_oppor +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "Stop work" +msgstr "Eindtijd" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__timesheet_ids +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +msgid "Timesheet" +msgstr "Tijdlijst" diff --git a/crm_timesheet/i18n/pt.po b/crm_timesheet/i18n/pt.po new file mode 100644 index 0000000000..79576b5217 --- /dev/null +++ b/crm_timesheet/i18n/pt.po @@ -0,0 +1,84 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_timesheet +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-05-26 00:19+0000\n" +"Last-Translator: Pedro Castro Silva \n" +"Language-Team: none\n" +"Language: pt\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.10\n" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "" +msgstr "" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_account_analytic_line +msgid "Analytic Line" +msgstr "Linha Analítica" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_hr_timesheet_switch +msgid "Helper to quickly switch between timesheet lines" +msgstr "Ajudante para alternar rapidamente entre linhas de folhas de horas" + +#. module: crm_timesheet +#: model:ir.model.fields,help:crm_timesheet.field_crm_lead__show_time_control +msgid "Indicate which time control button to show, if any." +msgstr "" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_crm_lead +#: model:ir.model.fields,field_description:crm_timesheet.field_account_analytic_line__lead_id +msgid "Lead/Opportunity" +msgstr "Lead/Oportunidade" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__project_id +msgid "Project" +msgstr "Projeto" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__show_time_control +msgid "Show Time Control" +msgstr "" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_oppor +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "Start work" +msgstr "Iniciar Trabalho" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_oppor +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "Stop work" +msgstr "Parar Trabalho" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__timesheet_ids +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +msgid "Timesheet" +msgstr "Registo de horas" diff --git a/crm_timesheet/i18n/pt_BR.po b/crm_timesheet/i18n/pt_BR.po new file mode 100644 index 0000000000..13c991bd18 --- /dev/null +++ b/crm_timesheet/i18n/pt_BR.po @@ -0,0 +1,85 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_timesheet +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.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: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "" +msgstr "" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "" +msgstr "" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_account_analytic_line +msgid "Analytic Line" +msgstr "Linha Analítica" + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_hr_timesheet_switch +msgid "Helper to quickly switch between timesheet lines" +msgstr "" +"Auxiliar para alternar rapidamente entre linhas de apontamentos de horas" + +#. module: crm_timesheet +#: model:ir.model.fields,help:crm_timesheet.field_crm_lead__show_time_control +msgid "Indicate which time control button to show, if any." +msgstr "Indique qual botão de controle de tempo mostrar, se houver." + +#. module: crm_timesheet +#: model:ir.model,name:crm_timesheet.model_crm_lead +#: model:ir.model.fields,field_description:crm_timesheet.field_account_analytic_line__lead_id +msgid "Lead/Opportunity" +msgstr "Oportunidade" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__project_id +msgid "Project" +msgstr "Projeto" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__show_time_control +msgid "Show Time Control" +msgstr "Mostrar Controle de tempo" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_oppor +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "Start work" +msgstr "Iniciar Trabalho" + +#. module: crm_timesheet +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_kanban_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_leads +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_case_tree_view_oppor +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +#: model_terms:ir.ui.view,arch_db:crm_timesheet.view_crm_lead_kanban +msgid "Stop work" +msgstr "Parar Trabalho" + +#. module: crm_timesheet +#: model:ir.model.fields,field_description:crm_timesheet.field_crm_lead__timesheet_ids +#: model_terms:ir.ui.view,arch_db:crm_timesheet.crm_lead_view_form +msgid "Timesheet" +msgstr "Apontamento de Hora" diff --git a/crm_timesheet/models/__init__.py b/crm_timesheet/models/__init__.py new file mode 100644 index 0000000000..38013c449d --- /dev/null +++ b/crm_timesheet/models/__init__.py @@ -0,0 +1,2 @@ +from . import crm_lead +from . import account_analytic_line diff --git a/crm_timesheet/models/account_analytic_line.py b/crm_timesheet/models/account_analytic_line.py new file mode 100644 index 0000000000..d20ce24eb5 --- /dev/null +++ b/crm_timesheet/models/account_analytic_line.py @@ -0,0 +1,20 @@ +# Copyright 2015 Tecnativa - Antonio Espinosa +# Copyright 2015 Javier Iniesta +# Copyright 2017 Tecnativa - David Vidal +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models + + +class AccountAnalyticLine(models.Model): + _inherit = "account.analytic.line" + + lead_id = fields.Many2one( + comodel_name="crm.lead", + string="Lead/Opportunity", + ) + + @api.onchange("lead_id") + def _onchange_lead_id(self): + if self.lead_id.project_id: + self.project_id = self.lead_id.project_id.id diff --git a/crm_timesheet/models/crm_lead.py b/crm_timesheet/models/crm_lead.py new file mode 100644 index 0000000000..24c6a02237 --- /dev/null +++ b/crm_timesheet/models/crm_lead.py @@ -0,0 +1,31 @@ +# Copyright 2015 Tecnativa - Antonio Espinosa +# Copyright 2015 Javier Iniesta +# Copyright 2017 Tecnativa - David Vidal +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models + + +class CrmLead(models.Model): + _name = "crm.lead" + _inherit = ["crm.lead", "hr.timesheet.time_control.mixin"] + + project_id = fields.Many2one(comodel_name="project.project", string="Project") + timesheet_ids = fields.One2many( + comodel_name="account.analytic.line", + inverse_name="lead_id", + string="Timesheet", + ) + + @api.model + def _relation_with_timesheet_line(self): + return "lead_id" + + @api.depends("timesheet_ids.employee_id", "timesheet_ids.unit_amount") + def _compute_show_time_control(self): + return super()._compute_show_time_control() + + def button_start_work(self): + result = super().button_start_work() + result["context"].update({"default_project_id": self.project_id.id}) + return result diff --git a/crm_timesheet/pyproject.toml b/crm_timesheet/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/crm_timesheet/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/crm_timesheet/readme/CONTRIBUTORS.md b/crm_timesheet/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..18d3213dec --- /dev/null +++ b/crm_timesheet/readme/CONTRIBUTORS.md @@ -0,0 +1,15 @@ +- [Tecnativa](https://www.tecnativa.com) + - Antonio Espinosa + - Rafael Blasco + - Javier Iniesta + - David Vidal + - Vicent Cubells + - Jairo Llopis + - Carolina Fernandez + - Víctor Martínez +- Foram Shah \<\> + +- [Sygel](https://www.sygel.es) + - Harald Panten + - Valentin Vinagre + - Roger Sans diff --git a/crm_timesheet/readme/DESCRIPTION.md b/crm_timesheet/readme/DESCRIPTION.md new file mode 100644 index 0000000000..84a4c2f70e --- /dev/null +++ b/crm_timesheet/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module allows to generate timesheets from leads/opportunities. diff --git a/crm_timesheet/readme/ROADMAP.md b/crm_timesheet/readme/ROADMAP.md new file mode 100644 index 0000000000..02e5bf3c47 --- /dev/null +++ b/crm_timesheet/readme/ROADMAP.md @@ -0,0 +1,5 @@ +- Window actions crm.crm_lead_all_leads and + crm.crm_lead_opportunities_tree_view contexts are overwritten for + hiding the lead field in timesheet embedded view. As this is not + accumulative, this change might be lost by other module overwritting + the same action, or this masks another module overwritting. diff --git a/crm_timesheet/readme/USAGE.md b/crm_timesheet/readme/USAGE.md new file mode 100644 index 0000000000..c67b346c84 --- /dev/null +++ b/crm_timesheet/readme/USAGE.md @@ -0,0 +1 @@ +- In pipeline/lead forms you have Timesheet tab. diff --git a/crm_timesheet/security/ir.model.access.csv b/crm_timesheet/security/ir.model.access.csv new file mode 100644 index 0000000000..774fb37abe --- /dev/null +++ b/crm_timesheet/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_hr_timesheet_switch,access_hr_timesheet_switch,model_hr_timesheet_switch,hr_timesheet.group_hr_timesheet_user,1,1,1,1 diff --git a/crm_timesheet/static/description/icon.png b/crm_timesheet/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/crm_timesheet/static/description/icon.png differ diff --git a/crm_timesheet/static/description/index.html b/crm_timesheet/static/description/index.html new file mode 100644 index 0000000000..c2d184531c --- /dev/null +++ b/crm_timesheet/static/description/index.html @@ -0,0 +1,464 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

CRM Timesheet

+ +

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

+

This module allows to generate timesheets from leads/opportunities.

+

Table of contents

+ +
+

Usage

+
    +
  • In pipeline/lead forms you have Timesheet tab.
  • +
+
+
+

Known issues / Roadmap

+
    +
  • Window actions crm.crm_lead_all_leads and +crm.crm_lead_opportunities_tree_view contexts are overwritten for +hiding the lead field in timesheet embedded view. As this is not +accumulative, this change might be lost by other module overwritting +the same action, or this masks another module overwritting.
  • +
+
+
+

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
  • +
+
+
+

Contributors

+
    +
  • Tecnativa
      +
    • Antonio Espinosa
    • +
    • Rafael Blasco
    • +
    • Javier Iniesta
    • +
    • David Vidal
    • +
    • Vicent Cubells
    • +
    • Jairo Llopis
    • +
    • Carolina Fernandez
    • +
    • Víctor Martínez
    • +
    +
  • +
  • Foram Shah <foram.shah@initos.com>
  • +
  • Sygel
      +
    • Harald Panten
    • +
    • Valentin Vinagre
    • +
    • Roger Sans
    • +
    +
  • +
+
+
+

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/crm_timesheet/tests/__init__.py b/crm_timesheet/tests/__init__.py new file mode 100644 index 0000000000..0dbc16a6d4 --- /dev/null +++ b/crm_timesheet/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_account_analytic_line diff --git a/crm_timesheet/tests/test_account_analytic_line.py b/crm_timesheet/tests/test_account_analytic_line.py new file mode 100644 index 0000000000..798bf7d959 --- /dev/null +++ b/crm_timesheet/tests/test_account_analytic_line.py @@ -0,0 +1,74 @@ +# Copyright 2017 tecnativa - Jairo Llopis +# Copyright 2023 Tecnativa - Carolina Fernandez +# Copyright 2025 Tecnativa - Víctor Martínez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +from odoo import exceptions, fields +from odoo.tests.common import users + +from odoo.addons.project_timesheet_time_control.tests import ( + test_project_timesheet_time_control, +) + + +class AccountAnalyticLineCase( + test_project_timesheet_time_control.TestProjectTimesheetTimeControlBase +): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.user.group_ids |= cls.env.ref("sales_team.group_sale_salesman_all_leads") + cls.lead = ( + cls.env["crm.lead"] + .with_user(cls.user) + .create( + { + "name": "Test lead", + "project_id": cls.project.id, + } + ) + ) + cls.line.lead_id = cls.lead + + def test_onchange_lead(self): + """Changing the lead changes the associated project.""" + line = self.env["account.analytic.line"].new({"lead_id": self.lead.id}) + line._onchange_lead_id() + self.assertEqual(line.project_id, self.project) + + def test_aal_time_control_flow(self): + """Test account.analytic.line time controls.""" + resume_action = self.line.button_resume_work() + wizard = self._create_wizard(resume_action, self.line) + self.assertEqual(wizard.analytic_line_id, self.line) + self.assertEqual(wizard.project_id, self.line.project_id) + # Stop old timer, start new one + new_act = wizard.with_context(show_created_timer=True).action_switch() + new_line = self.env[new_act["res_model"]].browse(new_act["res_id"]) + self.assertEqual(new_line.lead_id, self.lead) + + @users("test-user") + def test_lead_time_control_flow(self): + """Test crm.lead time controls.""" + # Running line found, stop the timer + self.assertEqual(self.lead.show_time_control, "stop") + self.lead.button_end_work() + # No more running lines, cannot stop again + with self.assertRaises(exceptions.UserError): + self.lead.button_end_work() + # All lines stopped, start new one + self.assertEqual(self.lead.show_time_control, "start") + start_action = self.lead.button_start_work() + wizard = self._create_wizard(start_action, self.lead) + self.assertLessEqual(wizard.date_time, fields.Datetime.now()) + self.assertEqual( + wizard.analytic_line_id.account_id, self.lead.project_id.account_id + ) + self.assertEqual(wizard.name, self.line.name) + self.assertEqual(wizard.project_id, self.lead.project_id) + new_act = wizard.with_context(show_created_timer=True).action_switch() + new_line = self.env[new_act["res_model"]].browse(new_act["res_id"]) + self.assertEqual(new_line.employee_id, self.env.user.employee_ids) + self.assertEqual(new_line.project_id, self.project) + self.assertEqual(new_line.lead_id, self.lead) diff --git a/crm_timesheet/views/crm_lead_view.xml b/crm_timesheet/views/crm_lead_view.xml new file mode 100644 index 0000000000..866a99b20e --- /dev/null +++ b/crm_timesheet/views/crm_lead_view.xml @@ -0,0 +1,172 @@ + + + + + CRM - Leads with timesheets + crm.lead + + + +
+
+ + + + + + + + + + + + +
+ + + Add timesheet time controls to lead kanban + crm.lead + + + + + + + + + + + + + + Add timesheet time controls to lead tree + crm.lead + + + +