diff options
| author | Aurélien Warnon <awa@odoo.com> | 2019-11-15 13:53:56 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2020-04-15 07:37:43 +0000 |
| commit | 9620721884c6e6983e5fae4cd8c1a0c21c197ff4 (patch) | |
| tree | 1fc00cb17dc330fedf5e6a418acc440e79d758f3 /addons | |
| parent | 15b5b5f518e1a5654d7bc3c2b4b1d7311254b878 (diff) | |
[IMP] partner_autocomplete,crm_*: unify displayed "clearbit" information
PURPOSE
We make multiple calls to the clearbit API and the returned information are
shown in various different templates, although they contain the same
information.
The purpose of this commit is to unify the templates into a single one to
reduce code size and improve coherence.
SPECIFICATIONS
Currently, we have 3 ways of reaching out to the IAP clearbit api:
- When creating a partner (autocomplete service)
- When enriching an existing lead based on its email address
- When generating leads using the "Geneate Leads" button or using the website
visitors
Every time we use the service, we log a note in the model's chatter containing
all the information returned by the cleabit service (estimated annual revenue,
media links, sector, ...).
Though using different endpoints and methods, all the calls essentially return
the same data, and the templates could be unified for consistency.
This is the goal of this commit.
We merge the 3 separate templates of each modules into a unique template that
always renders the same information to the end user.
To do that, we had to find a common module to store the template, we chose
"partner_autocomplete" as it's installed anyway as soon as "crm_iap_lead_*" is
installed.
LINKS
PR #40349
Upgrade PR odoo/upgrade#775
Task 2081471
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/crm_iap_lead/__manifest__.py | 2 | ||||
| -rw-r--r-- | addons/crm_iap_lead/data/message_template.xml | 170 | ||||
| -rw-r--r-- | addons/crm_iap_lead/models/crm_iap_lead_helpers.py | 51 | ||||
| -rw-r--r-- | addons/crm_iap_lead/models/crm_iap_lead_mining_request.py | 16 | ||||
| -rw-r--r-- | addons/crm_iap_lead_enrich/__manifest__.py | 1 | ||||
| -rw-r--r-- | addons/crm_iap_lead_enrich/data/mail_data.xml | 73 | ||||
| -rw-r--r-- | addons/crm_iap_lead_enrich/models/crm_lead.py | 33 | ||||
| -rw-r--r-- | addons/crm_iap_lead_website/models/crm_reveal_rule.py | 12 | ||||
| -rw-r--r-- | addons/partner_autocomplete/models/res_partner.py | 6 | ||||
| -rw-r--r-- | addons/partner_autocomplete/views/additional_info_template.xml | 194 |
10 files changed, 192 insertions, 366 deletions
diff --git a/addons/crm_iap_lead/__manifest__.py b/addons/crm_iap_lead/__manifest__.py index 9ef73cca909..a59d254a678 100644 --- a/addons/crm_iap_lead/__manifest__.py +++ b/addons/crm_iap_lead/__manifest__.py @@ -5,7 +5,7 @@ 'name': 'Lead Generation', 'summary': 'Create Leads/Opportunities based on country, industries, size, etc.', 'category': 'Sales/CRM', - 'depends': ['iap', 'crm'], + 'depends': ['iap', 'crm', 'partner_autocomplete'], 'data': [ 'data/crm.iap.lead.industry.csv', 'data/crm.iap.lead.role.csv', diff --git a/addons/crm_iap_lead/data/message_template.xml b/addons/crm_iap_lead/data/message_template.xml index f228698fedf..7b7667479a6 100644 --- a/addons/crm_iap_lead/data/message_template.xml +++ b/addons/crm_iap_lead/data/message_template.xml @@ -1,123 +1,59 @@ <?xml version="1.0" encoding="utf-8"?> <odoo> - <template id="lead_message_template"> - <p>Opportunity created by Odoo Lead Generation</p> - <div style="background-color:#ffffff;padding:15px;"> - <table style="width:100%"> - <tr valign="top"> - <td></td> - <td rowspan="3"> - <img style="max-width: 80px;" t-attf-src="{{logo}}"/> - </td> - </tr> - <tr> - <td style="padding: 0 0 5px 0;"> - <span style="font-size:25px;vertical-align: middle;"> - <b><t t-esc="name"/></b> - </span> - <span style=""> - <a t-if="twitter" style="margin: 0 0 0 8px;" 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" style="margin: 0 0 0 8px;" 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" style="margin: 0 0 0 8px;" 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" style="margin: 0 0 0 8px;" target="_blank" t-attf-href="https://www.crunchbase.com/{{crunchbase}}"> - <img width="18px" height="18px" src="/crm_iap_lead/static/img/crunchbase.ico"/> - </a> - </span> - </td> - </tr> - <tr> - <td style="padding: 0 0 5px 0;"> - <span><t t-esc="description"/></span> - </td> - </tr> - <tr> - <td t-if="timezone" style="padding: 0 0 5px 0;"> - <img src="/web_editor/font_to_img/61463/rgb(135,90,123)/16"/> - <b>Timezone : </b> - <span><t t-esc="timezone"/></span> - <span> - <a target="_blank" t-att-href="timezone_url">(Time Now)</a> - </span> - </td> - </tr> - <tr> - <td t-if="phone_numbers" style="padding: 0 0 5px 0;"> - <img src="/web_editor/font_to_img/61589/rgb(135,90,123)/16"/> - <b>Phone :</b> - <t t-foreach="phone_numbers" t-as="phone_number"> - <span style="margin:0 5px;"> - <a target="_blank" t-attf-href="tel:{{phone_number}}"><t t-esc="phone_number"/></a> - </span> - </t> - </td> - </tr> - <tr> - <td t-if="tech" colspan="2"> - <b><img src="/web_editor/font_to_img/61874/rgb(135,90,123)/16"/> Technology Used :</b> - <t t-foreach="tech" t-as="t"> - <label style="font-weight:normal;padding: 2px 10px;background-color: #eeeeee;margin: 0 0 4px 2px;border-radius: 13px;"> - <t t-esc="t"/> - </label> - </t> - </td> - </tr> - </table> - <div t-if="people_data" style="font-size:16px;margin: 9px 0;"> - <b>Contacts</b> - </div> - <table style="width:100%; - border-top-style: solid;border-top-color: #eeeeee;border-top-width: 1px; - border-bottom-style: solid;border-bottom-color: #eeeeee;border-bottom-width: 1px; - border-left-style: solid;border-left-color: #eeeeee;border-left-width: 1px; - border-right-style: solid;border-right-color: #eeeeee;border-right-width: 1px;" t-if="people_data"> - <thead> - <tr style="background-color: #eeeeee"> - <th style="padding: 5px"> - Name - </th> - <th style="padding: 5px"> - Title - </th> - <th style="padding: 5px"> - <img src="web_editor/font_to_img/61664/rgb(102,102,102)/13"/> - Email - </th> - <th style="padding: 5px"> - <img src="web_editor/font_to_img/61589/rgb(102,102,102)/13"/> - Phone - </th> - </tr> - </thead> - <tbody> - <t t-foreach="people_data" t-as="people"> - <tr t-att-style="people_odd and 'background-color:#eeeeee' or None"> - <td style="padding: 5px"> - <t t-esc="people['full_name'] or ''"/> - </td> - <td style="padding: 5px"> - <t t-esc="people['title'] or ''"/> - </td> - <td style="padding: 5px"> - <a t-if="people['email']" t-attf-href="mailto:{{people['email']}}" target="_top"> - <t t-esc="people['email']"/> - </a> - </td> - <td style="padding: 5px"> - <a t-if="people['phone']" t-attf-href="tel:{{people['phone']}}"> - <t t-esc="people['phone']"/> - </a> - </td> + <template id="enrich_service_information" inherit_id="partner_autocomplete.enrich_service_information"> + <xpath expr="//div[hasclass('o_partner_autocomplete_enrich_info')]" position="inside"> + <t t-if="people_data"> + <div style="font-size:16px; margin: 9px 0;"> + <b>Contacts</b> + </div> + <table style="width:100%; + border-top-style: solid;border-top-color: #eeeeee;border-top-width: 1px; + border-bottom-style: solid;border-bottom-color: #eeeeee;border-bottom-width: 1px; + border-left-style: solid;border-left-color: #eeeeee;border-left-width: 1px; + border-right-style: solid;border-right-color: #eeeeee;border-right-width: 1px;" t-if="people_data"> + <thead> + <tr style="background-color: #eeeeee"> + <th style="padding: 5px; width: 20%;"> + Name + </th> + <th style="padding: 5px; width: 20%;"> + Title + </th> + <th style="padding: 5px; width: 30%;"> + <img style="vertical-align: text-top;" src="web_editor/font_to_img/61664/rgb(102,102,102)/13"/> + Email + </th> + <th style="padding: 5px; width: 30%;"> + <img style="vertical-align: text-top;" src="web_editor/font_to_img/61589/rgb(102,102,102)/13"/> + Phone + </th> </tr> - </t> - </tbody> - </table> - </div> + </thead> + <tbody> + <t t-foreach="people_data" t-as="people"> + <tr t-att-style="people_odd and 'background-color:#eeeeee' or None"> + <td style="padding: 5px"> + <t t-esc="people['full_name'] or ''"/> + </td> + <td style="padding: 5px"> + <t t-esc="people['title'] or ''"/> + </td> + <td style="padding: 5px"> + <a t-if="people['email']" t-attf-href="mailto:{{people['email']}}" target="_top"> + <t t-esc="people['email']"/> + </a> + </td> + <td style="padding: 5px"> + <a t-if="people['phone']" t-attf-href="tel:{{people['phone']}}"> + <t t-esc="people['phone']"/> + </a> + </td> + </tr> + </t> + </tbody> + </table> + </t> + </xpath> </template> </odoo> diff --git a/addons/crm_iap_lead/models/crm_iap_lead_helpers.py b/addons/crm_iap_lead/models/crm_iap_lead_helpers.py index 03f741f7ff5..4c327a9c8b2 100644 --- a/addons/crm_iap_lead/models/crm_iap_lead_helpers.py +++ b/addons/crm_iap_lead/models/crm_iap_lead_helpers.py @@ -51,7 +51,6 @@ class CRMHelpers(models.Model): 'zip': company_data['postal_code'], 'country_id': country_id, 'state_id': self._find_state_id(company_data['state_code'], country_id), - 'description': self._prepare_lead_description(company_data), } # If type is people then add first contact in lead data @@ -69,53 +68,3 @@ class CRMHelpers(models.Model): if state_id: return state_id.id return False - - @api.model - def _prepare_lead_description(self, reveal_data): - description = '' - if reveal_data['sector']: - description += reveal_data['sector'] - if reveal_data['website_title']: - description += '\n' + reveal_data['website_title'] - if reveal_data['twitter_bio']: - description += '\n' + "Twitter Bio: " + reveal_data['twitter_bio'] - if reveal_data['twitter_followers']: - description += ('\nTwitter %s followers, %s \n') % (reveal_data['twitter_followers'], reveal_data['twitter_location'] or '') - - numbers = ['raised', 'market_cap', 'employees', 'estimated_annual_revenue'] - millnames = ['', ' K', ' M', ' B', 'T'] - - def millify(n): - try: - n = float(n) - millidx = max(0, min(len(millnames) - 1, int(floor(0 if n == 0 else log10(abs(n)) / 3)))) - return '{:.0f}{}'.format(n / 10**(3 * millidx), millnames[millidx]) - except Exception: - return n - - for key in numbers: - if reveal_data.get(key): - description += ' %s : %s,' % (key.replace('_', ' ').title(), millify(reveal_data[key])) - return description - - @api.model - def format_data_for_message_post(self, company_data, people_data): - log_data = { - 'twitter': company_data['twitter'], - 'description': company_data['description'], - 'logo': company_data['logo'], - 'name': company_data['name'], - 'phone_numbers': company_data['phone_numbers'], - 'facebook': company_data['facebook'], - 'linkedin': company_data['linkedin'], - 'crunchbase': company_data['crunchbase'], - 'tech': [t.replace('_', ' ').title() for t in company_data['tech']], - 'people_data': people_data, - } - timezone = company_data['timezone'] - if timezone: - log_data.update({ - 'timezone': timezone.replace('_', ' ').title(), - 'timezone_url': company_data['timezone_url'], - }) - return log_data diff --git a/addons/crm_iap_lead/models/crm_iap_lead_mining_request.py b/addons/crm_iap_lead/models/crm_iap_lead_mining_request.py index 7ab2477f014..b62e454ccbb 100644 --- a/addons/crm_iap_lead/models/crm_iap_lead_mining_request.py +++ b/addons/crm_iap_lead/models/crm_iap_lead_mining_request.py @@ -160,15 +160,21 @@ class CRMLeadMiningRequest(models.Model): def _create_leads_from_response(self, result): """ This method will get the response from the service and create the leads accordingly """ self.ensure_one() - lead_vals = [] + lead_vals_list = [] messages_to_post = {} for data in result: - lead_vals.append(self._lead_vals_from_response(data)) - messages_to_post[data['company_data']['clearbit_id']] = self.env['crm.iap.lead.helpers'].format_data_for_message_post(data['company_data'], data.get('people_data')) - leads = self.env['crm.lead'].create(lead_vals) + lead_vals_list.append(self._lead_vals_from_response(data)) + + template_values = data['company_data'] + template_values.update({ + 'flavor_text': _("Opportunity created by Odoo Lead Generation"), + 'people_data': data.get('people_data'), + }) + messages_to_post[data['company_data']['clearbit_id']] = template_values + 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('crm_iap_lead.lead_message_template', values=messages_to_post[lead.reveal_id], subtype_id=self.env.ref('mail.mt_note').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) # Methods responsible for format response data into valid odoo lead data @api.model diff --git a/addons/crm_iap_lead_enrich/__manifest__.py b/addons/crm_iap_lead_enrich/__manifest__.py index 09369e9beea..e31676329d1 100644 --- a/addons/crm_iap_lead_enrich/__manifest__.py +++ b/addons/crm_iap_lead_enrich/__manifest__.py @@ -8,6 +8,7 @@ 'depends': [ 'iap', 'crm', + 'partner_autocomplete' ], 'data': [ 'data/ir_cron.xml', diff --git a/addons/crm_iap_lead_enrich/data/mail_data.xml b/addons/crm_iap_lead_enrich/data/mail_data.xml index 9f8482618ee..8a3c575a9e2 100644 --- a/addons/crm_iap_lead_enrich/data/mail_data.xml +++ b/addons/crm_iap_lead_enrich/data/mail_data.xml @@ -21,77 +21,4 @@ <span>Your balance for Lead Enrichment is insufficient. Please go to your <a t-attf-href="{{url}}" target="_blank">IAP account</a> to buy credits.</span> </div> </template> - - <template id="mail_message_lead_enrich_with_data"> - <p> - <span>Lead enriched based on email address</span> - </p> - <div style="background-color:#ffffff;padding:15px;"> - <table style="width:100%"> - <tr valign="top"> - <td></td> - <td rowspan="3"> - <img style="max-width: 80px;" t-attf-src="{{logo}}"/> - </td> - </tr> - <tr> - <td style="padding: 0 0 5px 0;"> - <span style="font-size:25px;vertical-align: middle;"> - <b><t t-esc="name"/></b> - </span> - <span style=""> - <a t-if="twitter" style="margin: 0 0 0 8px;" 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" style="margin: 0 0 0 8px;" 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" style="margin: 0 0 0 8px;" 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" style="margin: 0 0 0 8px;" target="_blank" t-attf-href="https://www.crunchbase.com/{{crunchbase}}"> - <img width="18px" height="18px" src="/crm_iap_lead/static/img/crunchbase.ico"/> - </a> - </span> - </td> - </tr> - <tr> - <td style="padding: 0 0 5px 0;"> - <span><t t-esc="description"/></span> - </td> - </tr> - <tr> - <td t-if="timezone" style="padding: 0 0 5px 0;"> - <img src="/web_editor/font_to_img/61463/rgb(135,90,123)/16"/> - <b>Timezone : </b> - <span><t t-esc="timezone"/></span> - <span> - <a target="_blank" t-att-href="timezone_url">(Time Now)</a> - </span> - </td> - </tr> - <tr> - <td t-if="phone_numbers" style="padding: 0 0 5px 0;"> - <img src="/web_editor/font_to_img/61589/rgb(135,90,123)/16"/> - <b>Phone :</b> - <t t-foreach="phone_numbers" t-as="phone_number"> - <span style="margin:0 5px;"> - <a target="_blank" t-attf-href="tel:{{phone_number}}"><t t-esc="phone_number"/></a> - </span> - </t> - </td> - </tr> - <tr> - <td t-if="tech" colspan="2"> - <b><img src="/web_editor/font_to_img/61874/rgb(135,90,123)/16"/> Technology Used :</b> - <t t-foreach="tech" t-as="t"> - <label style="font-weight:normal;padding: 2px 10px;background-color: #eeeeee;margin: 0 0 4px 2px;border-radius: 13px;"> - <t t-esc="t"/> - </label> - </t> - </td> - </tr> - </table> - </div> - </template> </data></odoo> diff --git a/addons/crm_iap_lead_enrich/models/crm_lead.py b/addons/crm_iap_lead_enrich/models/crm_lead.py index 86bc421c54a..5b7438b5e20 100644 --- a/addons/crm_iap_lead_enrich/models/crm_lead.py +++ b/addons/crm_iap_lead_enrich/models/crm_lead.py @@ -4,7 +4,7 @@ import datetime import logging -from odoo import api, fields, models, tools +from odoo import _, api, fields, models, tools from odoo.addons.iap import InsufficientCreditError _logger = logging.getLogger(__name__) @@ -87,8 +87,8 @@ class Lead(models.Model): continue values = {'iap_enrich_done': True} - lead_fields = ['description', 'partner_name', 'reveal_id', 'street', 'city', 'zip'] - iap_fields = ['description', 'name', 'clearbit_id', 'location', 'city', 'postal_code'] + lead_fields = ['partner_name', 'reveal_id', 'street', 'city', 'zip'] + iap_fields = ['name', 'clearbit_id', 'location', 'city', 'postal_code'] for lead_field, iap_field in zip(lead_fields, iap_fields): if not lead[lead_field] and iap_data.get(iap_field): values[lead_field] = iap_data[iap_field] @@ -110,28 +110,11 @@ class Lead(models.Model): values['state_id'] = state.id lead.write(values) + + template_values = iap_data + template_values['flavor_text'] = _("Lead enriched based on email address") lead.message_post_with_view( - 'crm_iap_lead_enrich.mail_message_lead_enrich_with_data', - values=lead._iap_enrich_get_message_data(iap_data), + 'partner_autocomplete.enrich_service_information', + values=template_values, subtype_id=self.env.ref('mail.mt_note').id ) - - def _iap_enrich_get_message_data(self, company_data): - log_data = { - 'name': company_data.get('name'), - 'description': company_data.get('description'), - 'twitter': company_data.get('twitter'), - 'logo': company_data.get('logo'), - 'phone_numbers': company_data.get('phone_numbers'), - 'facebook': company_data.get('facebook'), - 'linkedin': company_data.get('linkedin'), - 'crunchbase': company_data.get('crunchbase'), - 'tech': [t.replace('_', ' ').title() for t in company_data.get('tech', [])], - } - timezone = company_data.get('timezone') - if timezone: - log_data.update({ - 'timezone': timezone.replace('_', ' ').title(), - 'timezone_url': company_data.get('timezone_url'), - }) - return log_data diff --git a/addons/crm_iap_lead_website/models/crm_reveal_rule.py b/addons/crm_iap_lead_website/models/crm_reveal_rule.py index 671aa6be16a..4da34077042 100644 --- a/addons/crm_iap_lead_website/models/crm_reveal_rule.py +++ b/addons/crm_iap_lead_website/models/crm_reveal_rule.py @@ -356,12 +356,20 @@ class CRMRevealRule(models.Model): # Does not create a lead if the reveal_id is already known return False lead_vals = rule._lead_vals_from_response(result) + lead = self.env['crm.lead'].create(lead_vals) + + template_values = result['reveal_data'] + template_values.update({ + 'flavor_text': _("Opportunity created by Odoo Lead Generation"), + 'people_data': result.get('people_data'), + }) lead.message_post_with_view( - 'crm_iap_lead.lead_message_template', - values=self.env['crm.iap.lead.helpers'].format_data_for_message_post(result['reveal_data'], result.get('people_data')), + 'partner_autocomplete.enrich_service_information', + values=template_values, subtype_id=self.env.ref('mail.mt_note').id ) + return lead # Methods responsible for format response data in to valid odoo lead data diff --git a/addons/partner_autocomplete/models/res_partner.py b/addons/partner_autocomplete/models/res_partner.py index 3be8ce1dd8c..0d0e0a2efc4 100644 --- a/addons/partner_autocomplete/models/res_partner.py +++ b/addons/partner_autocomplete/models/res_partner.py @@ -184,9 +184,11 @@ class ResPartner(models.Model): if len(vals_list) == 1: partners._update_autocomplete_data(vals_list[0].get('vat', False)) if partners.additional_info: + 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.additional_info_template', - values=json.loads(partners.additional_info), + 'partner_autocomplete.enrich_service_information', + values=template_values, subtype_id=self.env.ref('mail.mt_note').id, ) partners.write({'additional_info': False}) diff --git a/addons/partner_autocomplete/views/additional_info_template.xml b/addons/partner_autocomplete/views/additional_info_template.xml index 4de0b0b39a2..970e10edcf9 100644 --- a/addons/partner_autocomplete/views/additional_info_template.xml +++ b/addons/partner_autocomplete/views/additional_info_template.xml @@ -1,97 +1,111 @@ <?xml version="1.0" encoding="utf-8"?> <odoo> - <template id="additional_info_template"> - <p>Partner created by Odoo Partner Autocomplete Service</p> - <div class="bg-white mt-3 mb-3 p-5 mr-5"> - <h4> - <span class="mr-3" t-esc="name"/> - <a t-if="twitter" class="ml-2" target="_blank" t-attf-href="http://www.twitter.com/{{twitter}}"> - <img width="18px" height="18px" src="/partner_autocomplete/static/img/twitter.ico"/> - </a> - <a t-if="facebook" class="ml-2" target="_blank" t-attf-href="http://www.facebook.com/{{facebook}}"> - <img width="18px" height="18px" src="/partner_autocomplete/static/img/facebook.ico"/> - </a> - <a t-if="linkedin" class="ml-2" target="_blank" t-attf-href="https://www.linkedin.com/{{linkedin}}"> - <img width="18px" height="18px" src="/partner_autocomplete/static/img/linkedin.ico"/> - </a> - <a t-if="crunchbase" class="ml-2" target="_blank" t-attf-href="https://www.crunchbase.com/{{crunchbase}}"> - <img width="18px" height="18px" src="/partner_autocomplete/static/img/crunchbase.ico"/> - </a> - </h4> - <p t-esc="description"/> + <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/> - <p t-if="company_type"> - <i class="fa fa-fw mr-2 fa-building text-primary"/> - <b>Company type:</b> - <t t-esc="company_type"/> - </p> - <p t-if="founded_year"> - <i class="fa fa-fw mr-2 fa-calendar text-primary"/> - <b>Founded:</b> - <t t-esc="founded_year"/> - </p> - <p t-if="sector"> - <i class="fa fa-fw mr-2 fa-industry text-primary"/> - <b>Sector:</b> - <t t-foreach="sector" t-as="s"> - <label t-esc="s" style="font-weight:normal;padding: 2px 10px; background-color: #eeeeee; margin: 0 0 4px 2px; border-radius: 13px;"/> - </t> - </p> - <p t-if="employees"> - <i class="fa fa-fw mr-2 fa-users text-primary"/> - <b>Employees:</b> - <t t-esc="employees"/> - </p> - <p t-if="annual_revenue"> - <i class="fa fa-fw mr-2 fa-money text-primary"/> - <b>Annual revenue:</b> - <t t-esc="annual_revenue"/> - </p> - <p t-if="estimated_annual_revenue"> - <i class="fa fa-fw mr-2 fa-money text-primary"/> - <b>Estimated annual revenue:</b> - <t t-esc="estimated_annual_revenue"/> - </p> - <p t-if="twitter_bio"> - <i class="fa fa-fw mr-2 fa-twitter text-primary"/> - <b> - Twitter : - <span t-if="twitter_followers">(<t t-esc="twitter_followers"/> followers)</span> - </b> - <t t-esc="twitter_bio"/> - <br/> - </p> - - <p t-if="timezone"> - <i class="fa fa-fw mr-2 fa-globe text-primary"/> - <b>Timezone :</b> - <t t-esc="timezone"/> - <a target="_blank" t-att-href="timezone_url">(Time Now)</a> - </p> - <p t-if="phones"> - <i class="fa fa-fw mr-2 fa-phone text-primary"/> - <b>Phone :</b> - <t t-foreach="phones" t-as="phone_number"> - <a class="mr-3" t-attf-href="tel:{{phone_number}}" t-esc="phone_number"/> - </t> - </p> - <p t-if="emails"> - <i class="fa fa-fw mr-2 fa-envelope text-primary"/> - <b>Email :</b> - <t t-foreach="emails" t-as="email"> - <span style="margin:0 5px;"> - <a class="mr-3" target="_top" t-attf-href="mailto:{{email}}" t-esc="email"/> - </span> - </t> - </p> - <p t-if="tech"> - <i class="fa fa-fw mr-2 fa-cube text-primary"/> - <b>Technology Used :</b> - <t t-foreach="tech" t-as="t"> - <label t-esc="t" style="font-weight:normal; padding: 2px 10px; background-color: #eeeeee; margin: 0 0 4px 2px; border-radius: 13px;"/> - </t> - </p> + <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> |
