-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from sygel-technology/17.0-T-6494
[T-6494][17.0][ADD]crm_assign_project: allows to automatically assign a project to a CRM lead
- Loading branch information
Showing
18 changed files
with
773 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
================== | ||
CRM Assign Project | ||
================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:f12f92a7b3b43b634b25a7a9cfeb8d47e6e839783428e0a4f466c00ac654b700 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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-sygel--technology%2Fsy--crm-lightgray.png?logo=github | ||
:target: https://github.com/sygel-technology/sy-crm/tree/17.0/crm_assign_project | ||
:alt: sygel-technology/sy-crm | ||
|
||
|badge1| |badge2| |badge3| | ||
|
||
This module allows to automatically assign a project to a CRM lead when | ||
a lead/opportunity is created through an email. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Configuration | ||
============= | ||
|
||
To configure this module, you need to: | ||
|
||
1. Go to CRM > Configuration > Sales Teams and select a team. | ||
2. Check the 'Assign Project' checkbox | ||
3. Select a value in 'Automatically Assigned Project' | ||
|
||
Usage | ||
===== | ||
|
||
To usage this module, you need to: | ||
|
||
1. Create a new Lead, manually or sending a email to an alias, with a | ||
Crm Team with a project_id | ||
2. The created lead will have the configured project_id | ||
|
||
Known issues / Roadmap | ||
====================== | ||
|
||
- Manually created leads with the fast creation popup wizard won't have | ||
a default project_id, even if the user has a default team_id with a | ||
default project_id. The reason is this is made with an onchange. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/sygel-technology/sy-crm/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 <https://github.com/sygel-technology/sy-crm/issues/new?body=module:%20crm_assign_project%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
------- | ||
|
||
* Sygel | ||
|
||
Contributors | ||
------------ | ||
|
||
- Harald Panten harald.panten@sygel.es | ||
- Valentin Vinagre valentin.vinagre@sygel.es | ||
- Alberto Martínez alberto.martinez@sygel.es | ||
- Roger Sans roger.sans@sygel.es | ||
|
||
Maintainers | ||
----------- | ||
|
||
This module is part of the `sygel-technology/sy-crm <https://github.com/sygel-technology/sy-crm/tree/17.0/crm_assign_project>`_ project on GitHub. | ||
|
||
You are welcome to contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright 2022 Manuel Regidor <manuel.regidor@sygel.es> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2022 Manuel Regidor <manuel.regidor@sygel.es> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "CRM Assign Project", | ||
"summary": "Automatically assign project to CRM lead.", | ||
"version": "17.0.1.0.0", | ||
"category": "CRM", | ||
"website": "https://github.com/sygel-technology/sy-crm", | ||
"author": "Sygel, Odoo Community Association (OCA)", | ||
"license": "AGPL-3", | ||
"application": False, | ||
"installable": True, | ||
"depends": ["crm", "sales_team", "crm_timesheet"], | ||
"data": [ | ||
"views/crm_team_views.xml", | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * crm_assign_project | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 12.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2022-07-12 11:45+0000\n" | ||
"PO-Revision-Date: 2022-07-12 13:45+0200\n" | ||
"Last-Translator: <>\n" | ||
"Language-Team: \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" | ||
"Language: es\n" | ||
"X-Generator: Poedit 2.3\n" | ||
|
||
#. module: crm_assign_project | ||
#: model:ir.model.fields,field_description:crm_assign_project.field_crm_team__automatic_project_assignation | ||
msgid "Assign Project" | ||
msgstr "Asignar proyecto" | ||
|
||
#. module: crm_assign_project | ||
#: model:ir.model.fields,field_description:crm_assign_project.field_crm_team__automatic_assignation_project_id | ||
msgid "Automatically Assigned Project" | ||
msgstr "Proyecto asignado automáticamente" | ||
|
||
#. module: crm_assign_project | ||
#: model:ir.model,name:crm_assign_project.model_crm_team | ||
msgid "Sales Channels" | ||
msgstr "Canales de Ventas" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright 2022 Manuel Regidor <manuel.regidor@sygel.es> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import crm_team | ||
from . import crm_lead |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright 2022 Manuel Regidor <manuel.regidor@sygel.es> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, models | ||
|
||
|
||
class CrmLead(models.Model): | ||
_inherit = "crm.lead" | ||
|
||
@api.onchange("team_id") | ||
def _onchange_team_id(self): | ||
if ( | ||
self.team_id | ||
and self.team_id.automatic_project_assignation | ||
and self.team_id.automatic_assignation_project_id | ||
): | ||
self.project_id = self.team_id.automatic_assignation_project_id.id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright 2022 Manuel Regidor <manuel.regidor@sygel.es> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class CrmTeam(models.Model): | ||
_inherit = "crm.team" | ||
|
||
automatic_project_assignation = fields.Boolean( | ||
string="Assign Project", default=False | ||
) | ||
automatic_assignation_project_id = fields.Many2one( | ||
string="Automatically Assigned Project", | ||
comodel_name="project.project", | ||
) | ||
|
||
def write(self, vals): | ||
values = super().write(vals) | ||
if ( | ||
"automatic_project_assignation" in vals | ||
or "automatic_assignation_project_id" in vals | ||
) and self.alias_id: | ||
alias_values = self._alias_get_creation_values() | ||
self.alias_id.write({"alias_defaults": alias_values["alias_defaults"]}) | ||
return values | ||
|
||
def _alias_get_creation_values(self): | ||
values = super()._alias_get_creation_values() | ||
if self.automatic_project_assignation and self.automatic_assignation_project_id: | ||
values["alias_defaults"][ | ||
"project_id" | ||
] = self.automatic_assignation_project_id.id | ||
elif ( | ||
not self.automatic_project_assignation | ||
and values.get("alias_defaults") | ||
and values.get("alias_defaults").get("project_id") | ||
): | ||
values.get("alias_defaults").pop("project_id") | ||
return values |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
To configure this module, you need to: | ||
|
||
1. Go to CRM > Configuration > Sales Teams and select a team. | ||
2. Check the 'Assign Project' checkbox | ||
3. Select a value in 'Automatically Assigned Project' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- Harald Panten <harald.panten@sygel.es> | ||
- Valentin Vinagre <valentin.vinagre@sygel.es> | ||
- Alberto Martínez <alberto.martinez@sygel.es> | ||
- Roger Sans <roger.sans@sygel.es> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This module allows to automatically assign a project to a CRM lead when a lead/opportunity is created through an email. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Manually created leads with the fast creation popup wizard won't have a default project_id, even if the user has a default team_id with a default project_id. The reason is this is made with an onchange. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
To usage this module, you need to: | ||
|
||
1. Create a new Lead, manually or sending a email to an alias, with a Crm Team with a project_id | ||
2. The created lead will have the configured project_id |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.