Skip to content

Commit

Permalink
Add lead_id field to project_project for improved relationship tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
Gokac9 committed Dec 17, 2024
1 parent f49930f commit 91ba76e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions crm_project_create/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from . import crm_lead
from . import project
10 changes: 10 additions & 0 deletions crm_project_create/models/project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from odoo import fields, models


class ProjectProject(models.Model):
_inherit = "project.project"

lead_id = fields.Many2one(
"crm.lead",
string="Opportunity",
)
2 changes: 2 additions & 0 deletions crm_project_create/wizards/crm_create_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def _prepare_create_project_values(self):
"name": self.project_name,
"description": self.project_description,
"lead_id": self.lead_id.id,
"partner_id": self.lead_id.partner_id.id,
"company_id": self.lead_id.company_id.id,
}
)
else:
Expand Down

0 comments on commit 91ba76e

Please sign in to comment.