Files
survey-tools/survey_crm_generation_training/models/survey_user_input.py
clementthomas c3acf2065e [IMP] big refactoring :
use event_type instead of product_product
2024-01-09 11:55:20 +01:00

16 lines
588 B
Python

# Copyright 2022 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models, _
class SurveyUserInput(models.Model):
_inherit = "survey.user_input"
def _create_opportunity_post_process(self):
"""After lead creation from survey answer (module survey_crm_generation),
if answer (survey_user_input) contains event_type_ids, copy it in lead.
"""
self.opportunity_id.event_type_ids = self.event_type_ids.ids
return super(SurveyUserInput, self)._create_opportunity_post_process()