diff --git a/crm_timesheet/README.rst b/crm_timesheet/README.rst new file mode 100644 index 0000000000..a533adef50 --- /dev/null +++ b/crm_timesheet/README.rst @@ -0,0 +1,106 @@ +============= +CRM Timesheet +============= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:f03e4e5c08c95a4b18aee21412d4bd6ad3701f79d069f8928232ab0eb470c6d1 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/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-17-0/timesheet-17-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=17.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 + +- 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..6f34dab90a --- /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": "17.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..321bec9e53 --- /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 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: 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..7b7fb0411b --- /dev/null +++ b/crm_timesheet/models/account_analytic_line.py @@ -0,0 +1,20 @@ +# Copyright 2015 Antonio Espinosa +# Copyright 2015 Javier Iniesta +# Copyright 2017 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..a4ba84fc67 --- /dev/null +++ b/crm_timesheet/models/crm_lead.py @@ -0,0 +1,31 @@ +# Copyright 2015 Antonio Espinosa +# Copyright 2015 Javier Iniesta +# Copyright 2017 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..7a7617ed45 --- /dev/null +++ b/crm_timesheet/readme/CONTRIBUTORS.md @@ -0,0 +1,14 @@ +- [Tecnativa](https://www.tecnativa.com) + - Antonio Espinosa + - Rafael Blasco + - Javier Iniesta + - David Vidal + - Vicent Cubells + - Jairo Llopis + - Carolina Fernandez +- 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..be2953aec6 --- /dev/null +++ b/crm_timesheet/static/description/index.html @@ -0,0 +1,457 @@ + + + + + +CRM Timesheet + + + +
+

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
    • +
    +
  • +
  • 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..65437dbb9f --- /dev/null +++ b/crm_timesheet/tests/test_account_analytic_line.py @@ -0,0 +1,81 @@ +# Copyright 2017 Jairo Llopis +# Copyright 2023 Tecnativa - Carolina Fernandez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +from odoo.tests.common import TransactionCase + + +class AccountAnalyticLineCase(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + admin = cls.env.ref("base.user_admin") + # Stop any timer running + cls.env["account.analytic.line"].search( + [ + ("date_time", "!=", False), + ("user_id", "=", admin.id), + ("project_id.allow_timesheets", "=", True), + ("unit_amount", "=", 0), + ] + ).button_end_work() + admin.groups_id |= ( + cls.env.ref("hr_timesheet.group_hr_timesheet_user") + | cls.env.ref("sales_team.group_sale_salesman") + | cls.env.ref("project.group_project_manager") + ) + env = cls.env(user=admin) + Account = env["account.analytic.account"] + Project = env["project.project"] + cls.analytic_plan = cls.env["account.analytic.plan"].create({"name": "Default"}) + cls.account1 = Account.create( + {"name": "Test Account 1", "plan_id": cls.analytic_plan.id} + ) + cls.project1 = Project.create( + { + "name": "Test Project 1", + "analytic_account_id": cls.account1.id, + } + ) + cls.lead = env["crm.lead"].create( + { + "name": "Test lead", + "project_id": cls.project1.id, + } + ) + + def setUp(self): + super().setUp() + self.uid = self.ref("base.user_admin") + + def _create_wizard(self, action, active_record): + """Create a new hr.timesheet.switch wizard in the specified context. + :param dict action: Action definition that creates the wizard. + :param active_record: Record being browsed when creating the wizard. + """ + self.assertEqual(action["res_model"], "hr.timesheet.switch") + self.assertEqual(action["target"], "new") + self.assertEqual(action["type"], "ir.actions.act_window") + self.assertEqual(action["view_mode"], "form") + self.assertEqual(action["view_type"], "form") + return ( + active_record.env[action["res_model"]] + .with_context( + active_id=active_record.id, + active_ids=active_record.ids, + active_model=active_record._name, + **action.get("context", {}), + ) + .create({}) + ) + + 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.project1) diff --git a/crm_timesheet/views/crm_lead_view.xml b/crm_timesheet/views/crm_lead_view.xml new file mode 100644 index 0000000000..3baff730af --- /dev/null +++ b/crm_timesheet/views/crm_lead_view.xml @@ -0,0 +1,169 @@ + + + + + CRM - Leads with timesheets + crm.lead + + + +
+ +
+ + + + + + + + + + + + +
+ + + Add timesheet time controls to lead kanban + crm.lead + + + + + + + + + + + Add timesheet time controls to lead tree + crm.lead + + + + +