[ADD] iap_mail: bridge between mail and iap

PURPOSE

Clean and improve IAP services integration in Odoo. Clean IAP integrations
tools and improve data sharing with base modules, notably for CRM and Partner.

SPECIFICATIONS

In this commit we create a bridge module between iap and mail to hold notably
some notification data. It includes a template shared by several iap modules.

We also move its override in the right file and clearly rename assets file
in crm_iap_lead in order to clean a bit module organization.

LINKS

Task ID-2248367
Community PR odoo/odoo#53214
Enterprise PR odoo/enterprise#11258
Upgrade PR odoo/upgrade#1363
IAP PR odoo/iap-apps#191rade#
This commit is contained in:
Thibault Delavallée
2020-08-18 11:41:59 +00:00
parent fcd10b3691
commit 323890f7ea
15 changed files with 64 additions and 19 deletions
+7 -3
View File
@@ -5,19 +5,23 @@
'name': 'Lead Generation',
'summary': 'Create Leads/Opportunities based on country, industries, size, etc.',
'category': 'Sales/CRM',
'depends': ['iap', 'crm', 'partner_autocomplete'],
'version': '1.1',
'depends': [
'iap_mail',
'crm',
],
'data': [
'data/crm.iap.lead.industry.csv',
'data/crm.iap.lead.role.csv',
'data/crm.iap.lead.seniority.csv',
'data/message_template.xml',
'data/crm_iap_lead_data.xml',
'data/ir_sequence_data.xml',
'security/ir.model.access.csv',
'views/assets.xml',
'views/crm_lead_view.xml',
'views/crm_iap_lead_views.xml',
'views/res_config_settings_views.xml',
'views/crm_iap_lead_templates.xml',
'views/mail_templates.xml',
],
'qweb': [
'static/src/xml/leads_tree_generate_leads_views.xml',
@@ -204,7 +204,7 @@ class CRMLeadMiningRequest(models.Model):
leads = self.env['crm.lead'].create(lead_vals_list)
for lead in leads:
if messages_to_post.get(lead.reveal_id):
lead.message_post_with_view('partner_autocomplete.enrich_service_information', values=messages_to_post[lead.reveal_id], subtype_id=self.env.ref('mail.mt_note').id)
lead.message_post_with_view('iap_mail.enrich_company', values=messages_to_post[lead.reveal_id], subtype_id=self.env.ref('mail.mt_note').id)
# Methods responsible for format response data into valid odoo lead data
@api.model
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="enrich_service_information" inherit_id="partner_autocomplete.enrich_service_information">
<template id="enrich_company" inherit_id="iap_mail.enrich_company">
<xpath expr="//div[hasclass('o_partner_autocomplete_enrich_info')]" position="inside">
<t t-if="people_data">
<div style="font-size:16px; margin: 9px 0;">
+2 -2
View File
@@ -5,10 +5,10 @@
'name': 'Lead Enrichment',
'summary': 'Enrich Leads/Opportunities using email address domain',
'category': 'Sales/CRM',
'version': '1.1',
'depends': [
'iap',
'iap_mail',
'crm',
'partner_autocomplete'
],
'data': [
'data/ir_cron.xml',
@@ -114,7 +114,7 @@ class Lead(models.Model):
template_values = iap_data
template_values['flavor_text'] = _("Lead enriched based on email address")
lead.message_post_with_view(
'partner_autocomplete.enrich_service_information',
'iap_mail.enrich_company',
values=template_values,
subtype_id=self.env.ref('mail.mt_note').id
)
+7 -1
View File
@@ -4,8 +4,14 @@
{
'name': 'Lead Generation From Website Visits',
'summary': 'Create Leads/Opportunities from your website\'s traffic',
'version': '1.1',
'category': 'Sales/CRM',
'depends': ['iap', 'crm', 'website_form', 'crm_iap_lead'],
'depends': [
'iap_mail',
'crm',
'crm_iap_lead',
'website_form',
],
'data': [
'data/reveal_data.xml',
'security/ir.model.access.csv',
@@ -365,7 +365,7 @@ class CRMRevealRule(models.Model):
'people_data': result.get('people_data'),
})
lead.message_post_with_view(
'partner_autocomplete.enrich_service_information',
'iap_mail.enrich_company',
values=template_values,
subtype_id=self.env.ref('mail.mt_note').id
)
+21
View File
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': "IAP / Mail",
'summary': """Bridge between IAP and mail""",
'description': """Bridge between IAP and mail""",
'category': 'Hidden/Tools',
'version': '1.0',
'depends': [
'iap',
'mail',
],
'application': False,
'installable': True,
'auto_install': True,
'data': [
'views/mail_templates.xml',
],
}
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="enrich_service_information">
<template id="enrich_company">
<p t-esc="flavor_text" />
<div class="o_partner_autocomplete_enrich_info bg-white p-3 mt-3 mb-3 mr-5">
<div class="col-12 row p-0 m-0">
+6 -2
View File
@@ -1,7 +1,10 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': "Partner Autocomplete",
'summary': "Auto-complete partner companies' data",
'version': '1.1',
'description': """
Auto-complete partner companies' data
""",
@@ -9,11 +12,12 @@
'category': 'Hidden/Tools',
'version': '1.0',
'depends': ['web', 'mail', 'iap'],
'depends': [
'iap_mail',
],
'data': [
'security/ir.model.access.csv',
'views/partner_autocomplete_assets.xml',
'views/additional_info_template.xml',
'views/res_partner_views.xml',
'views/res_company_views.xml',
'views/res_config_settings_views.xml',
@@ -187,7 +187,7 @@ class ResPartner(models.Model):
template_values = json.loads(partners.additional_info)
template_values['flavor_text'] = _("Partner created by Odoo Partner Autocomplete Service")
partners.message_post_with_view(
'partner_autocomplete.enrich_service_information',
'iap_mail.enrich_company',
values=template_values,
subtype_id=self.env.ref('mail.mt_note').id,
)
+8 -2
View File
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'SMS gateway',
'version': '2.0',
'version': '2.1',
'category': 'Hidden/Tools',
'summary': 'SMS Text Messaging',
'description': """
@@ -11,7 +12,12 @@ This module gives a framework for SMS text messaging
The service is provided by the In App Purchase Odoo platform.
""",
'depends': ['base', 'iap', 'mail', 'phone_validation'],
'depends': [
'base',
'iap_mail',
'mail',
'phone_validation'
],
'data': [
'data/ir_cron_data.xml',
'wizard/sms_cancel_views.xml',
+5 -2
View File
@@ -6,8 +6,11 @@ Allows users to send documents by post
=====================================================
""",
'category': 'Hidden/Tools',
'version': '0.2',
'depends': ['iap', 'mail'],
'version': '0.3',
'depends': [
'iap_mail',
'mail'
],
'data': [
'data/snailmail_data.xml',
'views/report_assets.xml',
+1 -1
View File
@@ -4,7 +4,7 @@
{
'name': 'Base',
'version': '1.3',
'version': '1.4',
'category': 'Hidden',
'description': """
The kernel of Odoo, needed for all installation.