[NEW] first commit for all modules coming from training-tools
This commit is contained in:
1
survey_crm_generation_training/__init__.py
Normal file
1
survey_crm_generation_training/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import models
|
26
survey_crm_generation_training/__manifest__.py
Normal file
26
survey_crm_generation_training/__manifest__.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# Copyright 2016-2020 Akretion France (<https://www.akretion.com>)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
{
|
||||
"name": "Survey Crm Generation Training",
|
||||
'summary': 'Customize lead creation from survey according to trainings',
|
||||
'description': """
|
||||
Customize lead creation from survey according to trainings
|
||||
----------------------------------------------------
|
||||
* add event products in crm.lead
|
||||
* Copy event products selected in survey answer, to created lead
|
||||
|
||||
""",
|
||||
"version": "16.0.1.0.0",
|
||||
"license": "AGPL-3",
|
||||
"author": "Elabore",
|
||||
"website": "https://www.elabore.coop",
|
||||
"category": "",
|
||||
"depends": ["event","survey_crm_generation","survey_event_registration_generation","survey_event_base"],
|
||||
"data": [
|
||||
"views/crm_lead_views.xml"
|
||||
],
|
||||
"installable": True,
|
||||
"auto_install":True
|
||||
}
|
48
survey_crm_generation_training/i18n/fr.po
Normal file
48
survey_crm_generation_training/i18n/fr.po
Normal file
@@ -0,0 +1,48 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * survey_crm_generation_training
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 16.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-10-31 10:46+0000\n"
|
||||
"PO-Revision-Date: 2023-10-31 10:46+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: survey_crm_generation_training
|
||||
#: model_terms:ir.ui.view,arch_db:survey_crm_generation_training.crm_lead_view_for_crm_generation_training
|
||||
msgid ""
|
||||
"<span class=\"o_stat_value\">\n"
|
||||
" Responses\n"
|
||||
" </span>"
|
||||
msgstr ""
|
||||
"<span class=\"o_stat_value\">\n"
|
||||
" Réponses\n"
|
||||
" </span>"
|
||||
|
||||
#. module: survey_crm_generation_training
|
||||
#: model:ir.model.fields,field_description:survey_crm_generation_training.field_crm_lead__event_products_ids
|
||||
#: model_terms:ir.ui.view,arch_db:survey_crm_generation_training.view_crm_case_opportunities_filter_survey_crm_generation_training
|
||||
msgid "Event product"
|
||||
msgstr "Produit de formation"
|
||||
|
||||
#. module: survey_crm_generation_training
|
||||
#: model:ir.model,name:survey_crm_generation_training.model_crm_lead
|
||||
msgid "Lead/Opportunity"
|
||||
msgstr "Piste/Opportunité"
|
||||
|
||||
#. module: survey_crm_generation_training
|
||||
#: model:ir.model,name:survey_crm_generation_training.model_survey_user_input
|
||||
msgid "Survey User Input"
|
||||
msgstr "Entrée utilisateur du questionnaire"
|
||||
|
||||
#. module: survey_crm_generation_training
|
||||
#: model_terms:ir.ui.view,arch_db:survey_crm_generation_training.crm_lead_view_for_crm_generation_training
|
||||
msgid "View survey answer that created this lead"
|
||||
msgstr "Voir les réponses aux questionnaire qui ont créé cette piste"
|
2
survey_crm_generation_training/models/__init__.py
Normal file
2
survey_crm_generation_training/models/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from . import crm_lead
|
||||
from . import survey_user_input
|
23
survey_crm_generation_training/models/crm_lead.py
Normal file
23
survey_crm_generation_training/models/crm_lead.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# Copyright 2023 Tecnativa - David Vidal
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class CrmLead(models.Model):
|
||||
_inherit = "crm.lead"
|
||||
|
||||
event_products_ids = fields.Many2many('product.product', string='Event product')
|
||||
|
||||
|
||||
def action_view_survey_user_input_id(self):
|
||||
form_view_id = self.env.ref('survey.survey_user_input_view_form').id
|
||||
if self.survey_user_input_id:
|
||||
action = self.env["ir.actions.actions"]._for_xml_id("survey.action_survey_user_input")
|
||||
action['res_id'] = self.survey_user_input_id.id
|
||||
action['domain'] = [('id', '=', self.survey_user_input_id.id)]
|
||||
action['view_type'] = 'form'
|
||||
action['view_mode'] = 'form'
|
||||
action['binding_view_types'] = 'form'
|
||||
action['view_id'] = form_view_id
|
||||
action['views'] = [(form_view_id, 'form')]
|
||||
return action
|
15
survey_crm_generation_training/models/survey_user_input.py
Normal file
15
survey_crm_generation_training/models/survey_user_input.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# 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_products_ids, copy it in lead.
|
||||
"""
|
||||
self.opportunity_id.event_products_ids = self.event_products_ids.ids
|
||||
|
||||
return super(SurveyUserInput, self)._create_opportunity_post_process()
|
61
survey_crm_generation_training/views/crm_lead_views.xml
Normal file
61
survey_crm_generation_training/views/crm_lead_views.xml
Normal file
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="view_crm_case_opportunities_filter_survey_crm_generation_training" model="ir.ui.view">
|
||||
<field name="name">crm.lead.search.opportunity.crm.generation.training"</field>
|
||||
<field name="inherit_id" ref="crm.view_crm_case_opportunities_filter" />
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="arch" type="xml">
|
||||
<filter name="salesperson" position="before">
|
||||
<filter string="Event product" name="event_product" context="{'group_by':'event_products_ids'}" />
|
||||
</filter>
|
||||
<field name="tag_ids" position="before">
|
||||
<field name="event_products_ids" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="crm_lead_view_for_crm_generation_training" model="ir.ui.view">
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="name">crm.lead.crm.generation.training</field>
|
||||
<field name="inherit_id" ref="crm.crm_lead_view_form" />
|
||||
<field name="arch" type="xml">
|
||||
<div name="button_box" position="inside">
|
||||
<button class="oe_stat_button"
|
||||
name="action_view_survey_user_input_id"
|
||||
type="object"
|
||||
icon="fa-wpforms"
|
||||
help="View survey answer that created this lead"
|
||||
attrs="{'invisible': [('survey_user_input_id', '=', False)]}"
|
||||
>
|
||||
<div class="o_field_widget o_stat_info">
|
||||
<span class="o_stat_value">
|
||||
Responses
|
||||
</span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
<field name="survey_user_input_id" position="after">
|
||||
<field
|
||||
name="event_products_ids"
|
||||
readonly="1"
|
||||
attrs="{'invisible': [('event_products_ids', '=', False)]}"
|
||||
widget="many2many_tags"
|
||||
/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- CRM LEAD TREE VIEW -->
|
||||
<record id="crm_case_tree_view_oppor_survey_crm_generation_training" model="ir.ui.view">
|
||||
<field name="name">crm.lead.tree.opportunity.survey.crm.generation.training</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="priority">1</field>
|
||||
<field name="inherit_id" ref="crm.crm_case_tree_view_oppor" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<field name="event_products_ids" widget="many2many_tags" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
Reference in New Issue
Block a user