summaryrefslogtreecommitdiff
path: root/addons/partner_autocomplete
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2020-05-05 06:56:13 +0000
committerThibault Delavallée <tde@odoo.com>2020-08-18 11:41:59 +0000
commit323890f7ea68dde516f5c8dc2281e99b030c97ae (patch)
tree52c5364ba035d9f55b2586d6914f08931f6af475 /addons/partner_autocomplete
parentfcd10b3691c2291f224ac5083395edf0f00fc9ee (diff)
[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#
Diffstat (limited to 'addons/partner_autocomplete')
-rw-r--r--addons/partner_autocomplete/__manifest__.py8
-rw-r--r--addons/partner_autocomplete/models/res_partner.py2
-rw-r--r--addons/partner_autocomplete/views/additional_info_template.xml111
3 files changed, 7 insertions, 114 deletions
diff --git a/addons/partner_autocomplete/__manifest__.py b/addons/partner_autocomplete/__manifest__.py
index 4f898adc995..e4ff3294ef9 100644
--- a/addons/partner_autocomplete/__manifest__.py
+++ b/addons/partner_autocomplete/__manifest__.py
@@ -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',
diff --git a/addons/partner_autocomplete/models/res_partner.py b/addons/partner_autocomplete/models/res_partner.py
index 1c27a6b91ba..d53fcf2dfc9 100644
--- a/addons/partner_autocomplete/models/res_partner.py
+++ b/addons/partner_autocomplete/models/res_partner.py
@@ -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,
)
diff --git a/addons/partner_autocomplete/views/additional_info_template.xml b/addons/partner_autocomplete/views/additional_info_template.xml
deleted file mode 100644
index 970e10edcf9..00000000000
--- a/addons/partner_autocomplete/views/additional_info_template.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<odoo>
- <template id="enrich_service_information">
- <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">
- <div class="col-10 p-0">
- <h4>
- <span class="mr-3 align-middle" t-esc="name"/>
- <a t-if="twitter" class="ml-2" target="_blank" t-attf-href="http://www.twitter.com/{{twitter}}">
- <img src="/web_editor/font_to_img/61569/rgb(0,132,180)/22"/>
- </a>
- <a t-if="facebook" class="ml-2" target="_blank" t-attf-href="http://www.facebook.com/{{facebook}}">
- <img src="/web_editor/font_to_img/61570/rgb(59,89,152)/22"/>
- </a>
- <a t-if="linkedin" class="ml-2" target="_blank" t-attf-href="https://www.linkedin.com/{{linkedin}}">
- <img src="/web_editor/font_to_img/61580/rgb(0,119,181)/22"/>
- </a>
- <a t-if="crunchbase" class="ml-2" target="_blank" t-attf-href="https://www.crunchbase.com/{{crunchbase}}">
- <img width="19px" height="19px" src="/partner_autocomplete/static/img/crunchbase.ico"/>
- </a>
- </h4>
- <p t-esc="description"/>
- </div>
- <div class="col-2 p-0 text-right">
- <img t-attf-src="{{logo}}" alt="Company Logo" style="max-width: 80px;"/>
- </div>
- </div>
- <hr/>
-
- <div class="col-12 row m-0 p-0">
- <div t-if="company_type" class="my-1 p-0 col-3">
- <i class="fa fa-fw mr-2 fa-building text-primary"/>
- <b>Company type</b>
- </div>
- <div t-if="company_type" class="my-1 col-9" t-esc="company_type" />
- <div t-if="founded_year" class="my-1 p-0 col-3">
- <i class="fa fa-fw mr-2 fa-calendar text-primary"/>
- <b>Founded</b>
- </div>
- <div t-if="founded_year" class="my-1 col-9" t-esc="founded_year" />
- <t t-set="sectors" t-value="[]" />
- <t t-if="sector_primary" t-set="sectors" t-value="sectors + [sector_primary]" />
- <t t-if="industry" t-set="sectors" t-value="sectors + [industry]" />
- <t t-if="industry_group" t-set="sectors" t-value="sectors + [industry_group]" />
- <t t-if="sub_industry" t-set="sectors" t-value="sectors + [sub_industry]" />
- <div t-if="sectors" class="my-1 p-0 col-3">
- <i class="fa fa-fw mr-2 fa-industry text-primary"/>
- <b>Sectors</b>
- </div>
- <div t-if="sectors" class="my-1 col-9">
- <t t-foreach="sectors" t-as="inner_sector">
- <label t-esc="inner_sector" style="font-weight:normal; padding: 2px 10px; background-color: #eeeeee; margin: 1px 0px; border-radius: 13px;"/>
- </t>
- </div>
- <div t-if="employees" class="my-1 p-0 col-3">
- <i class="fa fa-fw mr-2 fa-users text-primary"/>
- <b>Employees</b>
- </div>
- <div t-if="employees" class="my-1 col-9" t-esc="'%.0f' % employees" />
- <div t-if="estimated_annual_revenue" class="my-1 p-0 col-3">
- <i class="fa fa-fw mr-2 fa-money text-primary"/>
- <b>Estimated revenue</b>
- </div>
- <div t-if="estimated_annual_revenue" class="my-1 col-9">
- <span t-esc="estimated_annual_revenue" /><span> per year</span>
- </div>
- <div t-if="phone_numbers" class="my-1 p-0 col-3">
- <i class="fa fa-fw mr-2 fa-phone text-primary"/>
- <b>Phone</b>
- </div>
- <div t-if="phone_numbers" class="col-9">
- <t t-foreach="phone_numbers" t-as="phone_number">
- <a t-attf-href="tel:{{phone_number}}" t-esc="phone_number" style="font-weight:normal; padding: 2px 10px; background-color: #eeeeee; margin: 1px 0px; border-radius: 13px;"/>
- </t>
- </div>
- <div t-if="email" class="my-1 p-0 col-3">
- <i class="fa fa-fw mr-2 fa-envelope text-primary"/>
- <b>Email</b>
- </div>
- <div t-if="email" class="col-9">
- <t t-foreach="email" t-as="email_item">
- <a target="_top" t-attf-href="mailto:{{email_item}}" t-esc="email_item" style="font-weight:normal; padding: 2px 10px; background-color: #eeeeee; margin: 1px 0px; border-radius: 13px;"/>
- </t>
- </div>
- <div t-if="timezone" class="my-1 p-0 col-3">
- <i class="fa fa-fw mr-2 fa-globe text-primary"/>
- <b>Timezone</b>
- </div>
- <div t-if="timezone" class="my-1 col-9" t-esc="timezone.replace('_', ' ')" />
- <div t-if="tech" class="my-1 p-0 col-3">
- <i class="fa fa-fw mr-2 fa-cube text-primary"/>
- <b>Technologies Used</b>
- </div>
- <div t-if="tech" class="my-1 col-9">
- <t t-foreach="tech" t-as="tech_item">
- <label t-esc="tech_item.replace('_', ' ').title()" style="font-weight:normal; padding: 2px 10px; background-color: #eeeeee; margin: 1px 0px; border-radius: 13px;"/>
- </t>
- </div>
- <div t-if="twitter_bio" class="my-1 p-0 col-3">
- <i class="fa fa-fw mr-2 fa-twitter text-primary"/>
- <b>Twitter</b>
- </div>
- <div t-if="twitter_bio" class="my-1 col-9">
- <div t-if="twitter_followers"><t t-esc="twitter_followers"/> followers</div>
- <div t-esc="twitter_bio" />
- </div>
- </div>
- </div>
- </template>
-</odoo>