mirror of
https://github.com/bringout/oca-crm.git
synced 2026-04-18 22:32:06 +02:00
Add oca-crm submodule with 26 CRM modules
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
0e924979be
commit
0608132c9e
1296 changed files with 142509 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
|||
from . import crm_lead
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
# 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")
|
||||
|
||||
def toggle_active(self):
|
||||
"""Archive or reactivate the project and their analytic account on lead toggle."""
|
||||
res = super().toggle_active()
|
||||
for lead in self.filtered(lambda l: l.project_id):
|
||||
lead.sudo().project_id.active = lead.active
|
||||
lead.sudo().project_id.analytic_account_id.active = lead.active
|
||||
return res
|
||||
Loading…
Add table
Add a link
Reference in a new issue