mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-18 18:32:03 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
|
|
@ -0,0 +1,4 @@
|
|||
from . import res_config_settings
|
||||
from . import res_company
|
||||
from . import project_task
|
||||
from . import crm_lead
|
||||
|
|
@ -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
|
||||
|
|
@ -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")
|
||||
|
|
@ -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 ResCompany(models.Model):
|
||||
_inherit = "res.company"
|
||||
|
||||
crm_default_project_id = fields.Many2one("project.project")
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
# 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 ResConfigSettings(models.TransientModel):
|
||||
_inherit = "res.config.settings"
|
||||
|
||||
crm_default_project_id = fields.Many2one(
|
||||
related="company_id.crm_default_project_id", readonly=False
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue