diff --git a/crm_project_create/models/__init__.py b/crm_project_create/models/__init__.py index e66f0d6cf4e..bafd28d980d 100644 --- a/crm_project_create/models/__init__.py +++ b/crm_project_create/models/__init__.py @@ -1 +1,2 @@ from . import crm_lead +from . import project diff --git a/crm_project_create/models/project.py b/crm_project_create/models/project.py new file mode 100644 index 00000000000..6104dd2c204 --- /dev/null +++ b/crm_project_create/models/project.py @@ -0,0 +1,10 @@ +from odoo import fields, models + + +class ProjectProject(models.Model): + _inherit = "project.project" + + lead_id = fields.Many2one( + "crm.lead", + string="Opportunity", + ) diff --git a/crm_project_create/wizards/crm_create_project.py b/crm_project_create/wizards/crm_create_project.py index c0258b7679c..058086375a8 100644 --- a/crm_project_create/wizards/crm_create_project.py +++ b/crm_project_create/wizards/crm_create_project.py @@ -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: