Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][ADD] base_crm_project #510

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added base_crm_project/README.rst
Empty file.
1 change: 1 addition & 0 deletions base_crm_project/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
24 changes: 24 additions & 0 deletions base_crm_project/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2023 Moduon Team S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0)

{
"name": "Base CRM Project",
"summary": "Link between Crm and Task",
"version": "15.0.1.0.0",
"development_status": "Alpha",
"category": "Sales/CRM",
"website": "https://github.com/OCA/crm",
"author": "Moduon, Odoo Community Association (OCA)",
"maintainers": ["EmilioPascual"],
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"crm",
"project",
],
"data": [
"views/crm_lead.xml",
"views/project_task.xml",
],
}
43 changes: 43 additions & 0 deletions base_crm_project/i18n/base_crm_project.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_crm_project
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-27 13:28+0000\n"
"PO-Revision-Date: 2023-07-27 13:28+0000\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: base_crm_project
#: model:ir.model.fields,field_description:base_crm_project.field_crm_lead__task_count
msgid "#Task"
msgstr ""

#. module: base_crm_project
#: model:ir.model.fields,field_description:base_crm_project.field_project_task__lead_id
msgid "Lead"
msgstr ""

#. module: base_crm_project
#: model:ir.model,name:base_crm_project.model_crm_lead
#: model_terms:ir.ui.view,arch_db:base_crm_project.view_task_form2_inherit_base_crm_project
msgid "Lead/Opportunity"
msgstr ""

#. module: base_crm_project
#: model:ir.model,name:base_crm_project.model_project_task
#: model:ir.model.fields,field_description:base_crm_project.field_crm_lead__task_ids
msgid "Task"
msgstr ""

#. module: base_crm_project
#: model_terms:ir.ui.view,arch_db:base_crm_project.inherit_crm_lead_view_form_base_crm_project
msgid "Task(s)"
msgstr ""
45 changes: 45 additions & 0 deletions base_crm_project/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_crm_project
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-27 13:28+0000\n"
"PO-Revision-Date: 2023-07-27 15:30+0200\n"
"Last-Translator: Emilio Pascual <[email protected]>\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.3.1\n"

#. module: base_crm_project
#: model:ir.model.fields,field_description:base_crm_project.field_crm_lead__task_count
msgid "#Task"
msgstr "#Task"

#. module: base_crm_project
#: model:ir.model.fields,field_description:base_crm_project.field_project_task__lead_id
msgid "Lead"
msgstr "Iniciativa/Oportunidad"

#. module: base_crm_project
#: model:ir.model,name:base_crm_project.model_crm_lead
#: model_terms:ir.ui.view,arch_db:base_crm_project.view_task_form2_inherit_base_crm_project
msgid "Lead/Opportunity"
msgstr "Iniciativa/Oportunidad"

#. module: base_crm_project
#: model:ir.model,name:base_crm_project.model_project_task
#: model:ir.model.fields,field_description:base_crm_project.field_crm_lead__task_ids
msgid "Task"
msgstr "Tarea"

#. module: base_crm_project
#: model_terms:ir.ui.view,arch_db:base_crm_project.inherit_crm_lead_view_form_base_crm_project
msgid "Task(s)"
msgstr "Tareas"
2 changes: 2 additions & 0 deletions base_crm_project/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import project_task
from . import crm_lead
24 changes: 24 additions & 0 deletions base_crm_project/models/crm_lead.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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"

task_ids = fields.One2many("project.task", "lead_id")
task_count = fields.Integer("#Task", compute="_compute_task_count")

@api.depends("task_ids")
def _compute_task_count(self):
for lead in self:
lead.task_count = len(lead.task_ids)

def action_tasks(self):
self.ensure_one()
ctx = self._context.copy()
action = self.env.ref("project.action_view_task").sudo().read()[0]
ctx.update({"default_lead_id": self.id})
action.update({"context": ctx, "domain": [("lead_id", "=", self.id)]})
return action
10 changes: 10 additions & 0 deletions base_crm_project/models/project_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2023 Moduon Team S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0)

from odoo import fields, models


class CrmLead(models.Model):
_inherit = "project.task"

lead_id = fields.Many2one("crm.lead")
2 changes: 2 additions & 0 deletions base_crm_project/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Emilio Pascual (`Moduon <https://www.moduon.team/>`__)
* Rafael Blasco (`Moduon <https://www.moduon.team/>`__)
1 change: 1 addition & 0 deletions base_crm_project/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module added link between lead/oportunity and tasks
Binary file added base_crm_project/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading