| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<odoo> |
| 3 |
<record id="crm_iap_lead_mining_request_view_form" model="ir.ui.view"> |
| 4 |
<field name="name">crm.iap.lead.mining.request.view.form</field> |
| 5 |
<field name="model">crm.iap.lead.mining.request</field> |
| 6 |
<field name="arch" type="xml"> |
| 7 |
<form> |
| 8 |
<header> |
| 9 |
<button name="action_submit" type="object" string="Submit" class="oe_highlight" invisible="context.get('is_modal') or state != 'draft'"/> |
| 10 |
<button name="action_submit" type="object" string="Retry" class="oe_highlight" invisible="context.get('is_modal') or state != 'error'"/> |
| 11 |
<field name="state" widget="statusbar" statusbar_visible="draft,done" invisible="context.get('is_modal')"/> |
| 12 |
</header> |
| 13 |
<div class="alert alert-danger text-center" role="alert" invisible="not error_type"> |
| 14 |
<field name="error_type" invisible="1"/> |
| 15 |
<field name="lead_type" invisible="1"/> |
| 16 |
<span invisible="error_type != 'credits'"> |
| 17 |
<span>You do not have enough credits to submit this request. |
| 18 |
<button name="action_buy_credits" type="object" class="oe_inline p-0 border-0 align-top text-primary">Buy credits.</button> |
| 19 |
</span> |
| 20 |
</span> |
| 21 |
<span invisible="error_type != 'no_result'">Your request did not return any result (no credits were used). Try removing some filters.</span> |
| 22 |
</div> |
| 23 |
<sheet> |
| 24 |
<div class="oe_button_box" name="button_box"> |
| 25 |
<button name="action_get_opportunity_action" class="oe_stat_button" type="object" icon="fa-star" context="{'create': False}" invisible="lead_type != 'opportunity' or state != 'done'"> |
| 26 |
<div class="o_stat_info"> |
| 27 |
<field name="lead_count"/> |
| 28 |
<span class="o_stat_text">Opportunities</span> |
| 29 |
</div> |
| 30 |
</button> |
| 31 |
<button name="action_get_lead_action" class="oe_stat_button" type="object" icon="fa-star" groups="crm.group_use_lead" context="{'create': False}" invisible="lead_type != 'lead' or state != 'done'"> |
| 32 |
<div class="o_stat_info"> |
| 33 |
<field name="lead_count"/> |
| 34 |
<span class="o_stat_text">Leads</span> |
| 35 |
</div> |
| 36 |
</button> |
| 37 |
</div> |
| 38 |
<span invisible="context.get('is_modal')"> |
| 39 |
<div class="row"> |
| 40 |
<div class="col-md-6"> |
| 41 |
<div class="oe_title"> |
| 42 |
<h1> |
| 43 |
<field name="name"/> |
| 44 |
</h1> |
| 45 |
</div> |
| 46 |
</div> |
| 47 |
</div> |
| 48 |
</span> |
| 49 |
|
| 50 |
<h2>How many leads would you like?</h2> |
| 51 |
|
| 52 |
<group name="requests"> |
| 53 |
<group> |
| 54 |
<div class="o_row py-3"> |
| 55 |
<field name="lead_number" readonly="state == 'done'" nolabel="1" class="oe_inline pe-2 o_input_3ch o_field_highlight"/> |
| 56 |
<field name="search_type" widget="selection" readonly="state == 'done'" nolabel="1" class="oe_inline o_field_highlight"/> |
| 57 |
</div> |
| 58 |
</group> |
| 59 |
</group> |
| 60 |
|
| 61 |
<group> |
| 62 |
<group name="companies"> |
| 63 |
<field name="country_ids" widget="many2many_tags" required="True" readonly="state == 'done'" options="{'no_create': True, 'no_open': True}"/> |
| 64 |
<field name="available_state_ids" invisible="1"/> |
| 65 |
<field name="state_ids" widget="many2many_tags" placeholder="Pick States..." |
| 66 |
invisible="not country_ids or not available_state_ids" |
| 67 |
readonly="state == 'done'" |
| 68 |
domain="[('id', 'in', available_state_ids)]" options="{'no_create': True, 'no_open': True}"/> |
| 69 |
<field name="industry_ids" widget="many2many_tags" options="{'no_create': True, 'no_open': True}" class="o_industry o_field_highlight" required="1" readonly="state == 'done'"/> |
| 70 |
<field name="filter_on_size" readonly="state == 'done'"/> |
| 71 |
<label for="company_size_min" invisible="not filter_on_size"/> |
| 72 |
<div invisible="not filter_on_size"> |
| 73 |
From |
| 74 |
<field name="company_size_min" class="oe_inline px-2 o_input_5ch" readonly="state == 'done'" required="filter_on_size"/> |
| 75 |
to |
| 76 |
<field name="company_size_max" class="oe_inline px-2 o_input_7ch" readonly="state == 'done'" required="filter_on_size"/> |
| 77 |
employees |
| 78 |
</div> |
| 79 |
|
| 80 |
</group> |
| 81 |
<group name="lead_info"> |
| 82 |
<field name="lead_type" groups="crm.group_use_lead" invisible="context.get('is_modal')" readonly="state == 'done'"/> |
| 83 |
<field name="team_id" no_create="1" no_open="1" readonly="state == 'done'" context="{'kanban_view_ref': 'sales_team.crm_team_view_kanban'}"/> |
| 84 |
<field name="user_id" no_create="1" no_open="1" readonly="state == 'done'" widget="many2one_avatar_user"/> |
| 85 |
<field name="tag_ids" string="Default Tags" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True}" readonly="state == 'done'"/> |
| 86 |
</group> |
| 87 |
</group> |
| 88 |
|
| 89 |
<group name="contacts" invisible="search_type != 'people'"> |
| 90 |
<div colspan="2" class="py-3"> |
| 91 |
<field name="contact_number" readonly="state == 'done'" required="search_type == 'people'" nolabel="1" class="oe_inline pe-2 col-md-1 o_input_2ch"/> |
| 92 |
<span class="col-md-6">Extra contacts per Company</span> |
| 93 |
</div> |
| 94 |
</group> |
| 95 |
<group invisible="search_type != 'people'"> |
| 96 |
<group> |
| 97 |
<field name="contact_filter_type" widget="radio" readonly="state == 'done'" options="{'horizontal': true}"/> |
| 98 |
<field name="preferred_role_id" options="{'no_create_edit': True, 'no_quick_create': True, 'no_open': True}" invisible="contact_filter_type != 'role'" readonly="state == 'done'" required="search_type == 'people' and contact_filter_type == 'role'"/> |
| 99 |
<field name="role_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True, 'no_quick_create': True}" invisible="not preferred_role_id or contact_filter_type != 'role'" readonly="state == 'done'"/> |
| 100 |
<field name="seniority_id" options="{'no_create_edit': True, 'no_quick_create': True, 'no_open': True}" invisible="contact_filter_type != 'seniority'" readonly="state == 'done'" required="search_type == 'people' and contact_filter_type == 'seniority'"/> |
| 101 |
</group> |
| 102 |
</group> |
| 103 |
<footer> |
| 104 |
<button string="Generate Leads" name="action_submit" type="object" default_focus="1" class="btn-primary" invisible="not context.get('is_modal')" data-hotkey="q"/> |
| 105 |
<button string="Cancel" class="btn-secondary" special="cancel" data-hotkey="x" invisible="not context.get('is_modal')"/> |
| 106 |
</footer> |
| 107 |
</sheet> |
| 108 |
</form> |
| 109 |
</field> |
| 110 |
</record> |
| 111 |
|
| 112 |
<record id="crm_iap_lead_mining_request_view_tree" model="ir.ui.view"> |
| 113 |
<field name="name">crm.iap.lead.mining.request.view.list</field> |
| 114 |
<field name="model">crm.iap.lead.mining.request</field> |
| 115 |
<field name="arch" type="xml"> |
| 116 |
<list> |
| 117 |
<field name="name" decoration-bf="1"/> |
| 118 |
<field name="lead_number" string="Number of Leads"/> |
| 119 |
<field name="search_type"/> |
| 120 |
<field name="country_ids" widget="many2many_tags"/> |
| 121 |
<field name="industry_ids" widget="many2many_tags"/> |
| 122 |
<field name="team_id" optional="hide"/> |
| 123 |
<field name="user_id" optional="hide" widget="many2one_avatar_user"/> |
| 124 |
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}" optional="hide"/> |
| 125 |
<field name="state" readonly="1" decoration-info="state == 'draft'" decoration-success="state == 'done'" decoration-danger="state == 'error'" widget="badge"/> |
| 126 |
</list> |
| 127 |
</field> |
| 128 |
</record> |
| 129 |
|
| 130 |
<record id="crm_iap_lead_mining_request_view_search" model="ir.ui.view"> |
| 131 |
<field name="name">crm.iap.lead.mining.request.view.search</field> |
| 132 |
<field name="model">crm.iap.lead.mining.request</field> |
| 133 |
<field name="arch" type="xml"> |
| 134 |
<search string="Lead Mining Request"> |
| 135 |
<field name="name"/> |
| 136 |
<field name="industry_ids"/> |
| 137 |
<field name="country_ids"/> |
| 138 |
<field name="team_id"/> |
| 139 |
<field name="user_id"/> |
| 140 |
<field name="tag_ids"/> |
| 141 |
<filter name="state_is_draft" string="Draft" domain="[('state', '=', 'draft')]"/> |
| 142 |
<filter name="state_is_done" string="Done" domain="[('state', '=', 'done')]"/> |
| 143 |
<filter name="state_is_error" string="Error" domain="[('state', '=', 'error')]"/> |
| 144 |
<separator/> |
| 145 |
<filter name="type_is_lead" string="Leads" domain="[('lead_type', '=', 'lead')]"/> |
| 146 |
<filter name="type_is_opportunity" string="Opportunities" domain="[('lead_type', '=', 'opportunity')]"/> |
| 147 |
<group> |
| 148 |
<filter string="Type" name="groupby_lead_type" domain="[]" context="{'group_by':'lead_type'}"/> |
| 149 |
<filter string="Sales Team" name="groupby_team_id" domain="[]" context="{'group_by':'team_id'}"/> |
| 150 |
<filter string="Salesperson" name="groupby_user_id" domain="[]" context="{'group_by':'user_id'}"/> |
| 151 |
</group> |
| 152 |
</search> |
| 153 |
</field> |
| 154 |
</record> |
| 155 |
|
| 156 |
<record id="crm_iap_lead_mining_request_action" model="ir.actions.act_window"> |
| 157 |
<field name="name">Lead Mining Requests</field> |
| 158 |
<field name="res_model">crm.iap.lead.mining.request</field> |
| 159 |
<field name="view_mode">list,form</field> |
| 160 |
</record> |
| 161 |
</odoo> |