[IMP] code comment in several modules

This commit is contained in:
clementthomas
2023-10-04 16:55:29 +02:00
parent 915e2bf583
commit e24614f571
17 changed files with 65 additions and 123 deletions

View File

@@ -8,4 +8,4 @@ class SurveySurvey(models.Model):
generate_speaker = fields.Boolean(
help="Generate speaker for selected event",
)
) #Field to check if user wants to generate a speaker on survey submit

View File

@@ -15,9 +15,10 @@ _logger = logging.getLogger(__name__)
class SurveyUserInput(models.Model):
_inherit = 'survey.user_input'
speaker_id = fields.Many2one('res.partner', 'Event speaker')
speaker_id = fields.Many2one('res.partner', 'Event speaker') #created partner when submit survey
def _get_event(self):
"""Find event selected, in all answers"""
for line in self.user_input_line_ids:
if line.question_id.question_type == 'event' and not line.skipped \
and line.answer_type != "suggestion" \
@@ -26,6 +27,7 @@ class SurveyUserInput(models.Model):
def _create_speaker_post_process(self, speaker):
"""Add message to chatter to note speaker creation and association with event"""
speaker.message_post_with_view(
"survey_event_speaker_generation.message_event_speaker_assigned",
values={"speaker": speaker, "user_input": self, "event":self._get_event()},

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Message notification in res.partner chatter -->
<template id="message_event_speaker_assigned">
<div style="margin: 0px; padding: 0px; font-size: 13px;">
<a href="#" t-att-data-oe-model="speaker._name" t-att-data-oe-id="speaker.id">

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- Survey form -->
<record id="survey_form" model="ir.ui.view">
<field name="model">survey.survey</field>
<field name="inherit_id" ref="survey.survey_survey_view_form" />