mirror of
https://github.com/bringout/oca-ocb-crm.git
synced 2026-04-26 22:12:03 +02:00
Initial commit: Crm packages
This commit is contained in:
commit
21a345b5b9
654 changed files with 418312 additions and 0 deletions
|
|
@ -0,0 +1,157 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="crm_iap_lead_mining_request_view_form" model="ir.ui.view">
|
||||
<field name="name">crm.iap.lead.mining.request.view.form</field>
|
||||
<field name="model">crm.iap.lead.mining.request</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<header>
|
||||
<button name="action_submit" type="object" string="Submit" states="draft" class="oe_highlight" invisible="context.get('is_modal')"/>
|
||||
<button name="action_submit" type="object" string="Retry" states="error" class="oe_highlight" invisible="context.get('is_modal')"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,done" invisible="context.get('is_modal')"/>
|
||||
</header>
|
||||
<div class="alert alert-danger text-center my-0" role="alert" attrs="{'invisible': [('error_type', '=', False)]}">
|
||||
<field name="error_type" invisible="1"/>
|
||||
<field name="lead_type" invisible="1"/>
|
||||
<span attrs="{'invisible': [('error_type', '!=', 'credits')]}">
|
||||
<span>You do not have enough credits to submit this request.
|
||||
<button name="action_buy_credits" type="object" class="oe_inline p-0 border-0 align-top text-primary">Buy credits.</button>
|
||||
</span>
|
||||
</span>
|
||||
<span attrs="{'invisible': [('error_type', '!=', 'no_result')]}">Your request did not return any result (no credits were used). Try removing some filters.</span>
|
||||
</div>
|
||||
<sheet>
|
||||
<div class="oe_button_box" name="button_box">
|
||||
<button name="action_get_opportunity_action" class="oe_stat_button" type="object" icon="fa-star" attrs="{'invisible': ['|', ('lead_type', '!=', 'opportunity'), ('state', '!=' , 'done')]}">
|
||||
<div class="o_stat_info">
|
||||
<field name="lead_count"/>
|
||||
<span class="o_stat_text">Opportunities</span>
|
||||
</div>
|
||||
</button>
|
||||
<button name="action_get_lead_action" class="oe_stat_button" type="object" icon="fa-star" groups="crm.group_use_lead" attrs="{'invisible': ['|', ('lead_type', '!=', 'lead'), ('state', '!=' , 'done')]}">
|
||||
<div class="o_stat_info">
|
||||
<field name="lead_count"/>
|
||||
<span class="o_stat_text">Leads</span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
<span invisible="context.get('is_modal')">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="name"/>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
<h2>What do you need ?</h2>
|
||||
|
||||
<group name="requests">
|
||||
<group>
|
||||
<div class="o_row py-3">
|
||||
<field name="lead_number" attrs="{'readonly': [('state', '=', 'done')]}" nolabel="1" class="oe_inline pe-2 o_input_3ch"/>
|
||||
<field name="search_type" widget="selection" attrs="{'readonly': [('state', '=', 'done')]}" nolabel="1" class="oe_inline"/>
|
||||
</div>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<group name="companies">
|
||||
<field name="country_ids" widget="many2many_tags" attrs="{'readonly': [('state', '=', 'done')]}" required="True" options="{'no_create': True, 'no_open': True}"/>
|
||||
<field name="available_state_ids" invisible="1"/>
|
||||
<field name="state_ids" widget="many2many_tags"
|
||||
attrs="{'invisible': ['|', ('country_ids', '=', []), ('available_state_ids', '=', [])], 'readonly': [('state', '=', 'done')]}"
|
||||
domain="[('id', 'in', available_state_ids)]" options="{'no_create': True, 'no_open': True}"/>
|
||||
<field name="industry_ids" widget="many2many_tags" attrs="{'readonly': [('state', '=', 'done')]}" options="{'no_create': True, 'no_open': True}" class="o_industry" required="1"/>
|
||||
<field name="filter_on_size" attrs="{'readonly': [('state', '=', 'done')]}"/>
|
||||
<label for="company_size_min" attrs="{'invisible': [('filter_on_size', '=', False)]}"/>
|
||||
<div attrs="{'invisible': [('filter_on_size', '=', False)]}">
|
||||
From
|
||||
<field name="company_size_min" class="oe_inline px-2 o_input_5ch" attrs="{'required': [('filter_on_size', '=', True)], 'readonly': [('state', '=', 'done')]}"/>
|
||||
to
|
||||
<field name="company_size_max" class="oe_inline px-2 o_input_7ch" attrs="{'required': [('filter_on_size', '=', True)], 'readonly': [('state', '=', 'done')]}"/>
|
||||
employees
|
||||
</div>
|
||||
|
||||
</group>
|
||||
<group name="lead_info">
|
||||
<field name="lead_type" groups="crm.group_use_lead" invisible="context.get('is_modal')" attrs="{'readonly': [('state', '=', 'done')]}"/>
|
||||
<field name="team_id" no_create="1" no_open="1" attrs="{'readonly': [('state', '=', 'done')]}" kanban_view_ref="%(sales_team.crm_team_view_kanban)s"/>
|
||||
<field name="user_id" no_create="1" no_open="1" attrs="{'readonly': [('state', '=', 'done')]}"/>
|
||||
<field name="tag_ids" string="Default Tags" widget="many2many_tags" attrs="{'readonly': [('state', '=', 'done')]}"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<group name="contacts" attrs="{'invisible': [('search_type', '!=', 'people')]}">
|
||||
<div colspan="2" class="py-3">
|
||||
<field name="contact_number" attrs="{'readonly': [('state', '=', 'done')], 'required': [('search_type', '=', 'people')]}" nolabel="1" class="oe_inline pe-2 col-md-1 o_input_2ch"/>
|
||||
<span class="col-md-6">Extra contacts per Company</span>
|
||||
</div>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('search_type', '!=', 'people')]}">
|
||||
<group>
|
||||
<field name="contact_filter_type" widget="radio" attrs="{'readonly': [('state', '=', 'done')]}" options="{'horizontal': true}"/>
|
||||
<field name="preferred_role_id" options="{'no_create_edit': True, 'no_quick_create': True, 'no_open': True}" attrs="{'invisible': [('contact_filter_type','!=', 'role')], 'required': [('search_type', '=', 'people'), ('contact_filter_type', '=', 'role')], 'readonly': [('state', '=', 'done')]}"/>
|
||||
<field name="role_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True, 'no_quick_create': True}" attrs="{'invisible': ['|', ('preferred_role_id','=', False), ('contact_filter_type','!=', 'role')], 'readonly': [('state', '=', 'done')]}"/>
|
||||
<field name="seniority_id" options="{'no_create_edit': True, 'no_quick_create': True, 'no_open': True}" attrs="{'invisible': [('contact_filter_type', '!=', 'seniority')], 'required': [('search_type', '=', 'people'), ('contact_filter_type', '=', 'seniority')], 'readonly': [('state', '=', 'done')]}"/>
|
||||
</group>
|
||||
</group>
|
||||
<footer>
|
||||
<button string="Generate Leads" name="action_submit" type="object" default_focus="1" class="btn-primary" invisible="not context.get('is_modal')" data-hotkey="q"/>
|
||||
<button string="Cancel" class="btn-secondary" special="cancel" data-hotkey="z" invisible="not context.get('is_modal')"/>
|
||||
</footer>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="crm_iap_lead_mining_request_view_tree" model="ir.ui.view">
|
||||
<field name="name">crm.iap.lead.mining.request.view.tree</field>
|
||||
<field name="model">crm.iap.lead.mining.request</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="name" decoration-bf="1"/>
|
||||
<field name="display_lead_label" string="Number of Leads"/>
|
||||
<field name="search_type"/>
|
||||
<field name="country_ids" widget="many2many_tags"/>
|
||||
<field name="team_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="tag_ids" widget="many2many_tags"/>
|
||||
<field name="state" readonly="1" decoration-info="state == 'draft'" decoration-success="state == 'done'" decoration-danger="state == 'error'" widget="badge"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="crm_iap_lead_mining_request_view_search" model="ir.ui.view">
|
||||
<field name="name">crm.iap.lead.mining.request.view.search</field>
|
||||
<field name="model">crm.iap.lead.mining.request</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Lead Mining Request">
|
||||
<field name="name"/>
|
||||
<field name="team_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="tag_ids"/>
|
||||
<filter name="state_is_draft" string="Draft" domain="[('state', '=', 'draft')]"/>
|
||||
<filter name="state_is_done" string="Done" domain="[('state', '=', 'done')]"/>
|
||||
<filter name="state_is_error" string="Error" domain="[('state', '=', 'error')]"/>
|
||||
<separator/>
|
||||
<filter name="type_is_lead" string="Leads" domain="[('lead_type', '=', 'lead')]"/>
|
||||
<filter name="type_is_opportunity" string="Opportunities" domain="[('lead_type', '=', 'opportunity')]"/>
|
||||
<group expand="0" string="Group By">
|
||||
<filter string="Type" name="groupby_lead_type" domain="[]" context="{'group_by':'lead_type'}"/>
|
||||
<filter string="Sales Team" name="groupby_team_id" domain="[]" context="{'group_by':'team_id'}"/>
|
||||
<filter string="Salesperson" name="groupby_user_id" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="crm_iap_lead_mining_request_action" model="ir.actions.act_window">
|
||||
<field name="name">Lead Mining Requests</field>
|
||||
<field name="res_model">crm.iap.lead.mining.request</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<odoo>
|
||||
<record id="crm_lead_view_tree_opportunity" model="ir.ui.view">
|
||||
<field name="name">crm.lead.view.tree.opportunity.inherit.iap.mine</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="inherit_id" ref="crm.crm_case_tree_view_oppor" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//tree" position="attributes">
|
||||
<attribute name="js_class">crm_iap_lead_mining_request_tree</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="crm_lead_view_tree_lead" model="ir.ui.view">
|
||||
<field name="name">crm.lead.view.tree.lead.inherit.iap.mine</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="inherit_id" ref="crm.crm_case_tree_view_leads" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//tree" position="attributes">
|
||||
<attribute name="js_class">crm_iap_lead_mining_request_tree</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<!-- This menu is display in CRM app when crm_iap_lead is installed-->
|
||||
<menuitem
|
||||
id="crm_menu_lead_generation"
|
||||
name="Lead Generation"
|
||||
parent="crm.crm_menu_config"
|
||||
sequence="20"/>
|
||||
|
||||
<menuitem
|
||||
id="crm_iap_lead_mining_request_menu_action"
|
||||
action="crm_iap_lead_mining_request_action"
|
||||
parent="crm_menu_lead_generation"
|
||||
sequence="0"/>
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<odoo>
|
||||
<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">
|
||||
<t t-set="hasPhoneNumbers" t-value="any([people['phone'] for people in 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-start-style: solid;border-start-color: #eeeeee;border-start-width: 1px;
|
||||
border-end-style: solid;border-end-color: #eeeeee;border-end-width: 1px;" t-if="people_data">
|
||||
<thead>
|
||||
<tr style="background-color: #eeeeee">
|
||||
<th t-attf-style="padding: 5px; width: {{hasPhoneNumbers and '30%;' or '50%;'}}">
|
||||
<img style="vertical-align: text-top;" src="web_editor/font_to_img/61447/rgb(102,102,102)/13"/>
|
||||
Name
|
||||
</th>
|
||||
<th t-attf-style="padding: 5px; width: {{hasPhoneNumbers and '40%;' or '50%;'}}">
|
||||
<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%;" t-if="hasPhoneNumbers">
|
||||
<img style="vertical-align: text-top;" 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-set="fullName" t-value="people['full_name'] or ''"/>
|
||||
<t t-set="title" t-value="people['title'] or ''"/>
|
||||
<t t-if="fullName">
|
||||
<h5 style="margin: 0;"><t t-esc="fullName"/><t t-if="title">,</t></h5>
|
||||
</t>
|
||||
<small t-esc="title" t-if="title"/>
|
||||
</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" t-if="hasPhoneNumbers">
|
||||
<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>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="res_config_settings_view_form" model="ir.ui.view">
|
||||
<field name="name">res.config.settings.view.form.inherit.crm.iap.lead</field>
|
||||
<field name="model">res.config.settings</field>
|
||||
<field name="inherit_id" ref="crm.res_config_settings_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<div id="crm_iap_mine_settings" position="inside">
|
||||
<widget name="iap_buy_more_credits" service_name="reveal"/>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Loading…
Add table
Add a link
Reference in a new issue