diff --git a/crm_project_create/README.rst b/crm_project_create/README.rst new file mode 100644 index 00000000000..26a0afc6f79 --- /dev/null +++ b/crm_project_create/README.rst @@ -0,0 +1,119 @@ +================== +CRM Project Create +================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:220d84e7993e173d4df77097beee70cf54132d82819d1618bb96da638203e713 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcrm-lightgray.png?logo=github + :target: https://github.com/OCA/crm/tree/17.0/crm_project_create + :alt: OCA/crm +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/crm-17-0/crm-17-0-crm_project_create + :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/crm&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends the functionality of crm and project and allow you +to create a project from opportunity or lead. + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +Use Cases / Context +=================== + +This module was developed because sometimes you want to create the +project from the crm without creating a sales order, for example when +you want to plan a project. + +It will be useful for you if you want to create a project before +creating a quotation and confirming it or if you want to estimate, plan +or know if you have the capacity before making the sale. + +Usage +===== + +To use this module, you need to: + +1. Go to CRM > Sales > My Pipeline +2. Create a new opportunity or join an existing one. +3. Click on **Create project** in header. +4. A wizard is shown to fill project name and/or project description. +5. Click on **Create project**. +6. You can see project created in page **Extra Information**, inside + group **Misc**. +7. Is you have *Project: Administrator* permissions, you can edit the + project after creating it. + +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 +------- + +* Moduon + +Contributors +------------ + +- Emilio Pascual (`Moduon `__) + +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. + +.. |maintainer-EmilioPascual| image:: https://github.com/EmilioPascual.png?size=40px + :target: https://github.com/EmilioPascual + :alt: EmilioPascual +.. |maintainer-rafaelbn| image:: https://github.com/rafaelbn.png?size=40px + :target: https://github.com/rafaelbn + :alt: rafaelbn + +Current `maintainers `__: + +|maintainer-EmilioPascual| |maintainer-rafaelbn| + +This module is part of the `OCA/crm `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/crm_project_create/__init__.py b/crm_project_create/__init__.py new file mode 100644 index 00000000000..aee8895e7a3 --- /dev/null +++ b/crm_project_create/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import wizards diff --git a/crm_project_create/__manifest__.py b/crm_project_create/__manifest__.py new file mode 100644 index 00000000000..39d32e6226a --- /dev/null +++ b/crm_project_create/__manifest__.py @@ -0,0 +1,25 @@ +# Copyright 2024 Moduon Team S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) + +{ + "name": "CRM Project Create", + "summary": "Allow create projects from lead/opportunity", + "version": "17.0.1.0.0", + "development_status": "Alpha", + "category": "Sales/CRM", + "website": "https://github.com/OCA/crm", + "author": "Moduon, Odoo Community Association (OCA)", + "maintainers": ["EmilioPascual", "rafaelbn"], + "license": "LGPL-3", + "application": False, + "installable": True, + "depends": [ + "crm", + "sale_project", + ], + "data": [ + "security/ir.model.access.csv", + "wizards/crm_create_project.xml", + "views/crm_lead.xml", + ], +} diff --git a/crm_project_create/i18n/crm_project_create.pot b/crm_project_create/i18n/crm_project_create.pot new file mode 100644 index 00000000000..117333c577b --- /dev/null +++ b/crm_project_create/i18n/crm_project_create.pot @@ -0,0 +1,96 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_project_create +# +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_project_create +#: model_terms:ir.ui.view,arch_db:crm_project_create.crm_create_project_view_form +msgid "Cancel" +msgstr "" + +#. module: crm_project_create +#: model:ir.actions.act_window,name:crm_project_create.crm_create_project_action +#: model_terms:ir.ui.view,arch_db:crm_project_create.crm_create_project_view_form +#: model_terms:ir.ui.view,arch_db:crm_project_create.crm_lead_view_form_crm_project_project +msgid "Create Project" +msgstr "" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__create_uid +msgid "Created by" +msgstr "" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__create_date +msgid "Created on" +msgstr "" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__display_name +msgid "Display Name" +msgstr "" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__id +msgid "ID" +msgstr "" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project____last_update +msgid "Last Modified on" +msgstr "" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__write_date +msgid "Last Updated on" +msgstr "" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__lead_id +msgid "Lead" +msgstr "" + +#. module: crm_project_create +#: model:ir.model,name:crm_project_create.model_crm_lead +msgid "Lead/Opportunity" +msgstr "" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_lead__project_id +msgid "Project" +msgstr "" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__project_description +msgid "Project Description" +msgstr "" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__project_name +msgid "Project Name" +msgstr "" + +#. module: crm_project_create +#: model:ir.model,name:crm_project_create.model_crm_create_project +msgid "Wizart to create Project from Lead/Opportunity" +msgstr "" + +#. module: crm_project_create +#: model_terms:ir.ui.view,arch_db:crm_project_create.crm_create_project_view_form +msgid "You won't be able to edit this project after creating it" +msgstr "" diff --git a/crm_project_create/i18n/es.po b/crm_project_create/i18n/es.po new file mode 100644 index 00000000000..f9e3fcbad30 --- /dev/null +++ b/crm_project_create/i18n/es.po @@ -0,0 +1,116 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_create_project +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-07-17 12:20+0000\n" +"PO-Revision-Date: 2024-07-17 14:20+0200\n" +"Last-Translator: Emilio Pascual \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.4.4\n" + +#. module: crm_project_create +#: model_terms:ir.ui.view,arch_db:crm_project_create.crm_create_project_view_form +msgid "Cancel" +msgstr "Cancelar" + +#. module: crm_project_create +#: model:ir.actions.act_window,name:crm_project_create.crm_create_project_action +#: model_terms:ir.ui.view,arch_db:crm_project_create.crm_create_project_view_form +#: model_terms:ir.ui.view,arch_db:crm_project_create.crm_lead_view_form_crm_project_project +msgid "Create Project" +msgstr "Crear proyecto" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__create_uid +msgid "Created by" +msgstr "Creado por" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__create_date +msgid "Created on" +msgstr "Creado el" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__display_name +msgid "Display Name" +msgstr "Nombre mostrado" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__id +msgid "ID" +msgstr "" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project____last_update +msgid "Last Modified on" +msgstr "Última modificación el" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__write_uid +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__write_date +msgid "Last Updated on" +msgstr "Última actualización el" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__lead_id +msgid "Lead" +msgstr "Iniciativa/Oportundad" + +#. module: crm_project_create +#: model:ir.model,name:crm_project_create.model_crm_lead +msgid "Lead/Opportunity" +msgstr "Iniciativa/Oportundad" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_lead__project_id +msgid "Project" +msgstr "Proyecto" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__project_description +msgid "Project Description" +msgstr "Descripción del proyecto" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__project_name +msgid "Project Name" +msgstr "Nombre del proyecto" + +#. module: crm_project_create +#: model:ir.model,name:crm_project_create.model_crm_create_project +msgid "Wizart to create Project from Lead/Opportunity" +msgstr "Asistente para crear un proyecto desde la iniciativa/oportunidad" + +#. module: crm_project_create +#: model_terms:ir.ui.view,arch_db:crm_project_create.crm_create_project_view_form +msgid "You won't be able to edit this project after creating it" +msgstr "" + +#, python-format +#~ msgid "" +#~ "Project %(name)s created." +#~ msgstr "" +#~ "Proyecto %(name)s creado." + +#, python-format +#~ msgid "" +#~ "Project created from lead/opportunity %(name)s." +#~ msgstr "" +#~ "Proyecto creado desde la iniciativa/oportunidad %(name)s." diff --git a/crm_project_create/i18n/it.po b/crm_project_create/i18n/it.po new file mode 100644 index 00000000000..13817d39121 --- /dev/null +++ b/crm_project_create/i18n/it.po @@ -0,0 +1,99 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_project_create +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-07-31 15:58+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 5.6.2\n" + +#. module: crm_project_create +#: model_terms:ir.ui.view,arch_db:crm_project_create.crm_create_project_view_form +msgid "Cancel" +msgstr "Annulla" + +#. module: crm_project_create +#: model:ir.actions.act_window,name:crm_project_create.crm_create_project_action +#: model_terms:ir.ui.view,arch_db:crm_project_create.crm_create_project_view_form +#: model_terms:ir.ui.view,arch_db:crm_project_create.crm_lead_view_form_crm_project_project +msgid "Create Project" +msgstr "Crea progetto" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__create_uid +msgid "Created by" +msgstr "Creato da" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__create_date +msgid "Created on" +msgstr "Creato il" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__id +msgid "ID" +msgstr "ID" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__write_uid +msgid "Last Updated by" +msgstr "Ultimo aggiornamento di" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__write_date +msgid "Last Updated on" +msgstr "Ultimo aggiornamento il" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__lead_id +msgid "Lead" +msgstr "Contatto" + +#. module: crm_project_create +#: model:ir.model,name:crm_project_create.model_crm_lead +msgid "Lead/Opportunity" +msgstr "Contatto/Opportunità" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_lead__project_id +msgid "Project" +msgstr "Progetto" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__project_description +msgid "Project Description" +msgstr "Descrizione progetto" + +#. module: crm_project_create +#: model:ir.model.fields,field_description:crm_project_create.field_crm_create_project__project_name +msgid "Project Name" +msgstr "Nome progetto" + +#. module: crm_project_create +#: model:ir.model,name:crm_project_create.model_crm_create_project +msgid "Wizart to create Project from Lead/Opportunity" +msgstr "Procedura guidata per creare il progetto dal contatto/opportunità" + +#. module: crm_project_create +#: model_terms:ir.ui.view,arch_db:crm_project_create.crm_create_project_view_form +msgid "You won't be able to edit this project after creating it" +msgstr "Non si potrà modificare questo progetto deopo la creazione" diff --git a/crm_project_create/models/__init__.py b/crm_project_create/models/__init__.py new file mode 100644 index 00000000000..e66f0d6cf4e --- /dev/null +++ b/crm_project_create/models/__init__.py @@ -0,0 +1 @@ +from . import crm_lead diff --git a/crm_project_create/models/crm_lead.py b/crm_project_create/models/crm_lead.py new file mode 100644 index 00000000000..7bbd73a44ac --- /dev/null +++ b/crm_project_create/models/crm_lead.py @@ -0,0 +1,10 @@ +# Copyright 2024 Moduon Team S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) + +from odoo import fields, models + + +class CrmLead(models.Model): + _inherit = "crm.lead" + + project_id = fields.Many2one("project.project", string="Project") diff --git a/crm_project_create/pyproject.toml b/crm_project_create/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/crm_project_create/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/crm_project_create/readme/CONTEXT.md b/crm_project_create/readme/CONTEXT.md new file mode 100644 index 00000000000..bbc802f0269 --- /dev/null +++ b/crm_project_create/readme/CONTEXT.md @@ -0,0 +1,3 @@ +This module was developed because sometimes you want to create the project from the crm without creating a sales order, for example when you want to plan a project. + +It will be useful for you if you want to create a project before creating a quotation and confirming it or if you want to estimate, plan or know if you have the capacity before making the sale. diff --git a/crm_project_create/readme/CONTRIBUTORS.md b/crm_project_create/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..ee7b9a6c8ba --- /dev/null +++ b/crm_project_create/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Emilio Pascual ([Moduon](https://www.moduon.team/)) diff --git a/crm_project_create/readme/DESCRIPTION.md b/crm_project_create/readme/DESCRIPTION.md new file mode 100644 index 00000000000..bff2e47626f --- /dev/null +++ b/crm_project_create/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module extends the functionality of crm and project and allow you to create a project from opportunity or lead. diff --git a/crm_project_create/readme/USAGE.md b/crm_project_create/readme/USAGE.md new file mode 100644 index 00000000000..90367e31999 --- /dev/null +++ b/crm_project_create/readme/USAGE.md @@ -0,0 +1,11 @@ + + +To use this module, you need to: + +1. Go to CRM > Sales > My Pipeline +1. Create a new opportunity or join an existing one. +1. Click on **Create project** in header. +1. A wizard is shown to fill project name and/or project description. +1. Click on **Create project**. +1. You can see project created in page **Extra Information**, inside group **Misc**. +1. Is you have *Project: Administrator* permissions, you can edit the project after creating it. diff --git a/crm_project_create/security/ir.model.access.csv b/crm_project_create/security/ir.model.access.csv new file mode 100644 index 00000000000..e7cc87a419a --- /dev/null +++ b/crm_project_create/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_crm_create_project,crm.create.project,model_crm_create_project,sales_team.group_sale_salesman,1,1,1,1 diff --git a/crm_project_create/static/description/icon.png b/crm_project_create/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/crm_project_create/static/description/icon.png differ diff --git a/crm_project_create/static/description/index.html b/crm_project_create/static/description/index.html new file mode 100644 index 00000000000..64d544256c8 --- /dev/null +++ b/crm_project_create/static/description/index.html @@ -0,0 +1,455 @@ + + + + + +CRM Project Create + + + +
+

CRM Project Create

+ + +

Alpha License: LGPL-3 OCA/crm Translate me on Weblate Try me on Runboat

+

This module extends the functionality of crm and project and allow you +to create a project from opportunity or lead.

+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

Use Cases / Context

+

This module was developed because sometimes you want to create the +project from the crm without creating a sales order, for example when +you want to plan a project.

+

It will be useful for you if you want to create a project before +creating a quotation and confirming it or if you want to estimate, plan +or know if you have the capacity before making the sale.

+
+
+

Usage

+

To use this module, you need to:

+
    +
  1. Go to CRM > Sales > My Pipeline
  2. +
  3. Create a new opportunity or join an existing one.
  4. +
  5. Click on Create project in header.
  6. +
  7. A wizard is shown to fill project name and/or project description.
  8. +
  9. Click on Create project.
  10. +
  11. You can see project created in page Extra Information, inside +group Misc.
  12. +
  13. Is you have Project: Administrator permissions, you can edit the +project after creating it.
  14. +
+
+
+

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

+
    +
  • Moduon
  • +
+
+
+

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.

+

Current maintainers:

+

EmilioPascual rafaelbn

+

This module is part of the OCA/crm project on GitHub.

+

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

+
+
+
+ + diff --git a/crm_project_create/tests/__init__.py b/crm_project_create/tests/__init__.py new file mode 100644 index 00000000000..8e7e83bc28c --- /dev/null +++ b/crm_project_create/tests/__init__.py @@ -0,0 +1 @@ +from . import test_crm_create_project diff --git a/crm_project_create/tests/test_crm_create_project.py b/crm_project_create/tests/test_crm_create_project.py new file mode 100644 index 00000000000..4674742000c --- /dev/null +++ b/crm_project_create/tests/test_crm_create_project.py @@ -0,0 +1,65 @@ +# Copyright 2024 Moduon Team S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) + +from markupsafe import Markup + +from odoo.tests.common import Form, TransactionCase, users + +from odoo.addons.mail.tests.common import mail_new_test_user + + +class TestCrmCreateProject(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.company = cls.env["res.company"].create( + { + "name": "Company Test", + } + ) + cls.user_salesman = mail_new_test_user( + cls.env, + login="user_salesman", + name="User Salesman", + email="user_salesman@test.example.com", + company_id=cls.company.id, + groups="sales_team.group_sale_salesman", + ) + cls.partner = cls.env["res.partner"].create( + { + "name": "Partner Test", + } + ) + cls.lead = cls.env["crm.lead"].create( + { + "name": "Test Lead", + "type": "lead", + "partner_id": cls.partner.id, + "user_id": cls.user_salesman.id, + } + ) + + @users("user_salesman") + def test_crm_create_project(self): + """Test the creation of a project from a lead.""" + wizard_form = Form( + self.env["crm.create.project"].with_context( + active_model="crm.lead", + active_id=self.lead.id, + default_lead_id=self.lead.id, + default_project_name=self.lead.name, + ) + ) + self.assertEqual(wizard_form.project_name, self.lead.name) + + wizard_form.project_name = "Test Project" + wizard_form.project_description = "Test Description" + wizard = wizard_form.save() + wizard.create_project() + + self.assertTrue(self.lead.project_id) + self.assertEqual(self.lead.project_id.name, "Test Project") + self.assertEqual( + self.lead.project_id.description, + Markup("

Test Description

"), + ) diff --git a/crm_project_create/views/crm_lead.xml b/crm_project_create/views/crm_lead.xml new file mode 100644 index 00000000000..cb2fa0259a8 --- /dev/null +++ b/crm_project_create/views/crm_lead.xml @@ -0,0 +1,26 @@ + + + + + CRM Lead Form Create Project + crm.lead + + + +