diff --git a/crm_partner_assign/README.rst b/crm_partner_assign/README.rst new file mode 100644 index 00000000000..6a1500febf9 --- /dev/null +++ b/crm_partner_assign/README.rst @@ -0,0 +1,126 @@ +================== +CRM Partner Assign +================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:d7416d52b55cc52565e9b0ed82ac4cda387335d70caa59a89f4abde41c7b24fb + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-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%2Fcrm-lightgray.png?logo=github + :target: https://github.com/OCA/crm/tree/17.0/crm_partner_assign + :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_partner_assign + :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 Leads to support assigning +an associate partner to leads and to allow you to check if a Lead is +being worked on by an associate partner. Also you can link a Partner to +another Partner as an implementation partner. + +.. 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: + +Installation +============ + +This module is the minimum viable product of the +*website_crm_partner_assign* module. If you have the *website* module +installed and you want a more complete module, take a look at the +*website_crm_partner_assign* module. This module uses the same field +names as the *website_crm_partner_assign* module, so if you want to use +*website_crm_partner_assign* and don't lose data, you must install +*website_crm_partner_assign* and then uninstall this module (in this +order). + +Usage +===== + +To use this module, you need to: + +1. Go to Lead and assign a partner to it. You can assign a partner + contact too. +2. You can filter the leads by assigned partner. +3. Go to Partner form and assign an partner to it. +4. You can group Partners by assigned partner. + +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 +------------ + +- Eduardo de Miguel (`Moduon `__) +- Rafael Blasco (`Moduon `__) +- `APSL `__: + + - Antoni Marroig + +Other credits +------------- + +The development of this module has been financially supported by: + +- Moduon Team S.L. + +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-Shide| image:: https://github.com/Shide.png?size=40px + :target: https://github.com/Shide + :alt: Shide + +Current `maintainer `__: + +|maintainer-Shide| + +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_partner_assign/__init__.py b/crm_partner_assign/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/crm_partner_assign/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/crm_partner_assign/__manifest__.py b/crm_partner_assign/__manifest__.py new file mode 100644 index 00000000000..f80e1196a97 --- /dev/null +++ b/crm_partner_assign/__manifest__.py @@ -0,0 +1,23 @@ +# Copyright 2023 Moduon Team S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0) + +{ + "name": "CRM Partner Assign", + "summary": "Assign a Partner to an Opportunity/Lead/Partner to indicate Partnership", + "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": ["Shide"], + "license": "AGPL-3", + "application": False, + "installable": True, + "depends": [ + "crm", + ], + "data": [ + "views/crm_lead_view.xml", + "views/res_partner_view.xml", + ], +} diff --git a/crm_partner_assign/i18n/crm_partner_assign.pot b/crm_partner_assign/i18n/crm_partner_assign.pot new file mode 100644 index 00000000000..26838abaece --- /dev/null +++ b/crm_partner_assign/i18n/crm_partner_assign.pot @@ -0,0 +1,79 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_partner_assign +# +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_partner_assign +#: model:ir.model.fields,field_description:crm_partner_assign.field_crm_lead__partner_assigned_id +msgid "Assigned Partner" +msgstr "" + +#. module: crm_partner_assign +#: model:ir.model.fields,field_description:crm_partner_assign.field_crm_lead__partner_contact_assigned_id +msgid "Assigned Partner Contact" +msgstr "" + +#. module: crm_partner_assign +#: model_terms:ir.ui.view,arch_db:crm_partner_assign.view_crm_case_leads_filter +#: model_terms:ir.ui.view,arch_db:crm_partner_assign.view_crm_case_opportunities_filter +#: model_terms:ir.ui.view,arch_db:crm_partner_assign.view_res_partner_filter +msgid "Assigned partner" +msgstr "" + +#. module: crm_partner_assign +#: model:ir.model,name:crm_partner_assign.model_res_partner +msgid "Contact" +msgstr "" + +#. module: crm_partner_assign +#: model:ir.model.fields,field_description:crm_partner_assign.field_res_partner__implemented_partner_ids +#: model:ir.model.fields,field_description:crm_partner_assign.field_res_users__implemented_partner_ids +msgid "Implementation References" +msgstr "" + +#. module: crm_partner_assign +#: model:ir.model.fields,field_description:crm_partner_assign.field_res_partner__implemented_count +#: model:ir.model.fields,field_description:crm_partner_assign.field_res_users__implemented_count +msgid "Implemented Count" +msgstr "" + +#. module: crm_partner_assign +#: model:ir.model.fields,field_description:crm_partner_assign.field_res_partner__assigned_partner_id +#: model:ir.model.fields,field_description:crm_partner_assign.field_res_users__assigned_partner_id +msgid "Implemented by" +msgstr "" + +#. module: crm_partner_assign +#: model:ir.model.fields,help:crm_partner_assign.field_crm_lead__date_partner_assign +msgid "Last date this case was assigned to a partner" +msgstr "" + +#. module: crm_partner_assign +#: model:ir.model,name:crm_partner_assign.model_crm_lead +msgid "Lead/Opportunity" +msgstr "" + +#. module: crm_partner_assign +#: model:ir.model.fields,field_description:crm_partner_assign.field_crm_lead__date_partner_assign +msgid "Partner Assignment Date" +msgstr "" + +#. module: crm_partner_assign +#: model:ir.model.fields,help:crm_partner_assign.field_crm_lead__partner_contact_assigned_id +msgid "Partner Contact this case has been assigned to." +msgstr "" + +#. module: crm_partner_assign +#: model:ir.model.fields,help:crm_partner_assign.field_crm_lead__partner_assigned_id +msgid "Partner this case has been assigned to." +msgstr "" diff --git a/crm_partner_assign/i18n/es.po b/crm_partner_assign/i18n/es.po new file mode 100644 index 00000000000..7e830f55a78 --- /dev/null +++ b/crm_partner_assign/i18n/es.po @@ -0,0 +1,83 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_partner_assign +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-04-18 10:36+0000\n" +"PO-Revision-Date: 2023-04-18 12:38+0200\n" +"Last-Translator: \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: \n" +"X-Generator: Poedit 3.1.1\n" + +#. module: crm_partner_assign +#: model:ir.model.fields,field_description:crm_partner_assign.field_crm_lead__partner_assigned_id +msgid "Assigned Partner" +msgstr "Partner asignado" + +#. module: crm_partner_assign +#: model:ir.model.fields,field_description:crm_partner_assign.field_crm_lead__partner_contact_assigned_id +msgid "Assigned Partner Contact" +msgstr "Contacto de Partner" + +#. module: crm_partner_assign +#: model_terms:ir.ui.view,arch_db:crm_partner_assign.view_crm_case_leads_filter +#: model_terms:ir.ui.view,arch_db:crm_partner_assign.view_crm_case_opportunities_filter +#: model_terms:ir.ui.view,arch_db:crm_partner_assign.view_res_partner_filter +msgid "Assigned partner" +msgstr "Partner asignado" + +#. module: crm_partner_assign +#: model:ir.model,name:crm_partner_assign.model_res_partner +msgid "Contact" +msgstr "Contacto" + +#. module: crm_partner_assign +#: model:ir.model.fields,field_description:crm_partner_assign.field_res_partner__implemented_partner_ids +#: model:ir.model.fields,field_description:crm_partner_assign.field_res_users__implemented_partner_ids +msgid "Implementation References" +msgstr "Referencias de implementación" + +#. module: crm_partner_assign +#: model:ir.model.fields,field_description:crm_partner_assign.field_res_partner__implemented_count +#: model:ir.model.fields,field_description:crm_partner_assign.field_res_users__implemented_count +msgid "Implemented Count" +msgstr "Recuento de implementaciones" + +#. module: crm_partner_assign +#: model:ir.model.fields,field_description:crm_partner_assign.field_res_partner__assigned_partner_id +#: model:ir.model.fields,field_description:crm_partner_assign.field_res_users__assigned_partner_id +msgid "Implemented by" +msgstr "Implementado por" + +#. module: crm_partner_assign +#: model:ir.model.fields,help:crm_partner_assign.field_crm_lead__date_partner_assign +msgid "Last date this case was assigned to a partner" +msgstr "Última fecha en la que este caso fue reenviado/asignado a un partner" + +#. module: crm_partner_assign +#: model:ir.model,name:crm_partner_assign.model_crm_lead +msgid "Lead/Opportunity" +msgstr "Lead/Oportunidad" + +#. module: crm_partner_assign +#: model:ir.model.fields,field_description:crm_partner_assign.field_crm_lead__date_partner_assign +msgid "Partner Assignment Date" +msgstr "Fecha de asignación del Partner" + +#. module: crm_partner_assign +#: model:ir.model.fields,help:crm_partner_assign.field_crm_lead__partner_contact_assigned_id +msgid "Partner Contact this case has been assigned to." +msgstr "Contacto de Partner al que este caso ha sido reenviado/asignado." + +#. module: crm_partner_assign +#: model:ir.model.fields,help:crm_partner_assign.field_crm_lead__partner_assigned_id +msgid "Partner this case has been assigned to." +msgstr "Partner al que este caso ha sido reenviado/asignado." diff --git a/crm_partner_assign/i18n/it.po b/crm_partner_assign/i18n/it.po new file mode 100644 index 00000000000..0e52b582869 --- /dev/null +++ b/crm_partner_assign/i18n/it.po @@ -0,0 +1,82 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_partner_assign +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-06-14 14:10+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: crm_partner_assign +#: model:ir.model.fields,field_description:crm_partner_assign.field_crm_lead__partner_assigned_id +msgid "Assigned Partner" +msgstr "Partner assegnato" + +#. module: crm_partner_assign +#: model:ir.model.fields,field_description:crm_partner_assign.field_crm_lead__partner_contact_assigned_id +msgid "Assigned Partner Contact" +msgstr "Contatto partner assegnato" + +#. module: crm_partner_assign +#: model_terms:ir.ui.view,arch_db:crm_partner_assign.view_crm_case_leads_filter +#: model_terms:ir.ui.view,arch_db:crm_partner_assign.view_crm_case_opportunities_filter +#: model_terms:ir.ui.view,arch_db:crm_partner_assign.view_res_partner_filter +msgid "Assigned partner" +msgstr "Partner assegnato" + +#. module: crm_partner_assign +#: model:ir.model,name:crm_partner_assign.model_res_partner +msgid "Contact" +msgstr "Contatto" + +#. module: crm_partner_assign +#: model:ir.model.fields,field_description:crm_partner_assign.field_res_partner__implemented_partner_ids +#: model:ir.model.fields,field_description:crm_partner_assign.field_res_users__implemented_partner_ids +msgid "Implementation References" +msgstr "Riferimento implementazione" + +#. module: crm_partner_assign +#: model:ir.model.fields,field_description:crm_partner_assign.field_res_partner__implemented_count +#: model:ir.model.fields,field_description:crm_partner_assign.field_res_users__implemented_count +msgid "Implemented Count" +msgstr "Conteggio implementazioni" + +#. module: crm_partner_assign +#: model:ir.model.fields,field_description:crm_partner_assign.field_res_partner__assigned_partner_id +#: model:ir.model.fields,field_description:crm_partner_assign.field_res_users__assigned_partner_id +msgid "Implemented by" +msgstr "Implementato da" + +#. module: crm_partner_assign +#: model:ir.model.fields,help:crm_partner_assign.field_crm_lead__date_partner_assign +msgid "Last date this case was assigned to a partner" +msgstr "Ultima data in cui questo argomento è stato assegnato ad un partner" + +#. module: crm_partner_assign +#: model:ir.model,name:crm_partner_assign.model_crm_lead +msgid "Lead/Opportunity" +msgstr "Contatto/Opportunità" + +#. module: crm_partner_assign +#: model:ir.model.fields,field_description:crm_partner_assign.field_crm_lead__date_partner_assign +msgid "Partner Assignment Date" +msgstr "Data assegnazione partner" + +#. module: crm_partner_assign +#: model:ir.model.fields,help:crm_partner_assign.field_crm_lead__partner_contact_assigned_id +msgid "Partner Contact this case has been assigned to." +msgstr "Contatto partner a cui è stato assegnato l'argomento." + +#. module: crm_partner_assign +#: model:ir.model.fields,help:crm_partner_assign.field_crm_lead__partner_assigned_id +msgid "Partner this case has been assigned to." +msgstr "Partner a cui è stato assegnato l'argomento." diff --git a/crm_partner_assign/models/__init__.py b/crm_partner_assign/models/__init__.py new file mode 100644 index 00000000000..61645768744 --- /dev/null +++ b/crm_partner_assign/models/__init__.py @@ -0,0 +1,2 @@ +from . import crm_lead +from . import res_partner diff --git a/crm_partner_assign/models/crm_lead.py b/crm_partner_assign/models/crm_lead.py new file mode 100644 index 00000000000..fedbb12277f --- /dev/null +++ b/crm_partner_assign/models/crm_lead.py @@ -0,0 +1,51 @@ +# Copyright 2023 Moduon Team S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0) + +from odoo import api, fields, models + + +class CRMLead(models.Model): + _inherit = "crm.lead" + + partner_contact_assigned_id = fields.Many2one( + comodel_name="res.partner", + domain="[('is_company', '=', False)]", + string="Assigned Partner Contact", + tracking=True, + help="Partner Contact this case has been assigned to.", + check_company=True, + ) + partner_assigned_id = fields.Many2one( + comodel_name="res.partner", + string="Assigned Partner", + help="Partner this case has been assigned to.", + related="partner_contact_assigned_id.commercial_partner_id", + store=True, + readonly=True, + check_company=True, + ) + date_partner_assign = fields.Date( + compute="_compute_date_partner_assign", + string="Partner Assignment Date", + readonly=False, + store=True, + copy=True, + help="Last date this case was assigned to a partner", + ) + + @api.depends("partner_assigned_id") + def _compute_date_partner_assign(self): + for lead in self: + if not lead.partner_assigned_id: + lead.date_partner_assign = False + else: + lead.date_partner_assign = fields.Date.context_today(lead) + + def _merge_get_fields(self): + fields_list = super()._merge_get_fields() + fields_list += [ + "partner_assigned_id", + "partner_contact_assigned_id", + "date_partner_assign", + ] + return fields_list diff --git a/crm_partner_assign/models/res_partner.py b/crm_partner_assign/models/res_partner.py new file mode 100644 index 00000000000..d8ba0275480 --- /dev/null +++ b/crm_partner_assign/models/res_partner.py @@ -0,0 +1,27 @@ +# Copyright 2023 Moduon Team S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0) + +from odoo import api, fields, models + + +class ResPartner(models.Model): + _inherit = "res.partner" + + assigned_partner_id = fields.Many2one( + comodel_name="res.partner", + string="Implemented by", + ) + implemented_partner_ids = fields.One2many( + comodel_name="res.partner", + inverse_name="assigned_partner_id", + string="Implementation References", + ) + implemented_count = fields.Integer( + compute="_compute_implemented_partner_count", + store=True, + ) + + @api.depends("implemented_partner_ids", "implemented_partner_ids.active") + def _compute_implemented_partner_count(self): + for partner in self: + partner.implemented_count = len(partner.implemented_partner_ids) diff --git a/crm_partner_assign/pyproject.toml b/crm_partner_assign/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/crm_partner_assign/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/crm_partner_assign/readme/CONTRIBUTORS.md b/crm_partner_assign/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..4f6ae2a6668 --- /dev/null +++ b/crm_partner_assign/readme/CONTRIBUTORS.md @@ -0,0 +1,4 @@ +- Eduardo de Miguel ([Moduon](https://www.moduon.team/)) +- Rafael Blasco ([Moduon](https://www.moduon.team/)) +- [APSL](https://apsl.tech): + - Antoni Marroig \<\> diff --git a/crm_partner_assign/readme/CREDITS.md b/crm_partner_assign/readme/CREDITS.md new file mode 100644 index 00000000000..98d1eaf17f7 --- /dev/null +++ b/crm_partner_assign/readme/CREDITS.md @@ -0,0 +1,3 @@ +The development of this module has been financially supported by: + +- Moduon Team S.L. diff --git a/crm_partner_assign/readme/DESCRIPTION.md b/crm_partner_assign/readme/DESCRIPTION.md new file mode 100644 index 00000000000..24128610cf2 --- /dev/null +++ b/crm_partner_assign/readme/DESCRIPTION.md @@ -0,0 +1,4 @@ +This module extends the functionality of CRM Leads to support assigning +an associate partner to leads and to allow you to check if a Lead is +being worked on by an associate partner. Also you can link a Partner to +another Partner as an implementation partner. diff --git a/crm_partner_assign/readme/INSTALL.md b/crm_partner_assign/readme/INSTALL.md new file mode 100644 index 00000000000..19f7b38f582 --- /dev/null +++ b/crm_partner_assign/readme/INSTALL.md @@ -0,0 +1,8 @@ +This module is the minimum viable product of the +*website_crm_partner_assign* module. If you have the *website* module +installed and you want a more complete module, take a look at the +*website_crm_partner_assign* module. This module uses the same field +names as the *website_crm_partner_assign* module, so if you want to use +*website_crm_partner_assign* and don't lose data, you must install +*website_crm_partner_assign* and then uninstall this module (in this +order). diff --git a/crm_partner_assign/readme/USAGE.md b/crm_partner_assign/readme/USAGE.md new file mode 100644 index 00000000000..bc847bb1baa --- /dev/null +++ b/crm_partner_assign/readme/USAGE.md @@ -0,0 +1,7 @@ +To use this module, you need to: + +1. Go to Lead and assign a partner to it. You can assign a partner + contact too. +2. You can filter the leads by assigned partner. +3. Go to Partner form and assign an partner to it. +4. You can group Partners by assigned partner. diff --git a/crm_partner_assign/static/description/icon.png b/crm_partner_assign/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/crm_partner_assign/static/description/icon.png differ diff --git a/crm_partner_assign/static/description/index.html b/crm_partner_assign/static/description/index.html new file mode 100644 index 00000000000..07ad8be63fc --- /dev/null +++ b/crm_partner_assign/static/description/index.html @@ -0,0 +1,469 @@ + + + + + + +CRM Partner Assign + + + +
+

CRM Partner Assign

+ + +

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

+

This module extends the functionality of CRM Leads to support assigning +an associate partner to leads and to allow you to check if a Lead is +being worked on by an associate partner. Also you can link a Partner to +another Partner as an implementation partner.

+
+

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

+ +
+

Installation

+

This module is the minimum viable product of the +website_crm_partner_assign module. If you have the website module +installed and you want a more complete module, take a look at the +website_crm_partner_assign module. This module uses the same field +names as the website_crm_partner_assign module, so if you want to use +website_crm_partner_assign and don’t lose data, you must install +website_crm_partner_assign and then uninstall this module (in this +order).

+
+
+

Usage

+

To use this module, you need to:

+
    +
  1. Go to Lead and assign a partner to it. You can assign a partner +contact too.
  2. +
  3. You can filter the leads by assigned partner.
  4. +
  5. Go to Partner form and assign an partner to it.
  6. +
  7. You can group Partners by assigned partner.
  8. +
+
+
+

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

+ +
+
+

Other credits

+

The development of this module has been financially supported by:

+
    +
  • Moduon Team S.L.
  • +
+
+
+

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 maintainer:

+

Shide

+

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_partner_assign/tests/__init__.py b/crm_partner_assign/tests/__init__.py new file mode 100644 index 00000000000..abce0675a0f --- /dev/null +++ b/crm_partner_assign/tests/__init__.py @@ -0,0 +1 @@ +from . import test_crm_lead diff --git a/crm_partner_assign/tests/test_crm_lead.py b/crm_partner_assign/tests/test_crm_lead.py new file mode 100644 index 00000000000..bdb1ca3bb0f --- /dev/null +++ b/crm_partner_assign/tests/test_crm_lead.py @@ -0,0 +1,22 @@ +# Copyright 2023 Moduon Team S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0) + +from odoo.tests.common import TransactionCase + + +class CRMLead(TransactionCase): + def test_crm_lead_date_partner_assign(self): + """Test that `date_partner_assign` is set when assigning a partner.""" + lead = self.env["crm.lead"].create( + { + "name": "Lead 1", + "partner_contact_assigned_id": self.env["res.partner"] + .create( + { + "name": "Partner 1", + } + ) + .id, + } + ) + self.assertTrue(lead.date_partner_assign) diff --git a/crm_partner_assign/views/crm_lead_view.xml b/crm_partner_assign/views/crm_lead_view.xml new file mode 100644 index 00000000000..fe583e7a236 --- /dev/null +++ b/crm_partner_assign/views/crm_lead_view.xml @@ -0,0 +1,87 @@ + + + + + crm.lead.form + crm.lead + + + + + + + + + + + + + + + + crm.lead.tree.lead + crm.lead + + + + + + + + + + + crm.lead.tree.opportunity + crm.lead + + + + + + + + + + + crm.lead.search.lead + crm.lead + + + + + + + + + + + + + crm.lead.search.opportunity + crm.lead + + + + + + + + + + + diff --git a/crm_partner_assign/views/res_partner_view.xml b/crm_partner_assign/views/res_partner_view.xml new file mode 100644 index 00000000000..4a6bec85f53 --- /dev/null +++ b/crm_partner_assign/views/res_partner_view.xml @@ -0,0 +1,30 @@ + + + + + res.partner.form + res.partner + + + + + + + + + + res.partner.select + res.partner + + + + + + + +