Skip to content
Snippets Groups Projects
Commit 81782e68 authored by Thibault Delavallée's avatar Thibault Delavallée
Browse files

[REF] crm: don't archive but mark as lost

People don't understand archive. According to POs leads are lost and restored
and not archived / unarchived. Let us restore the mark as lost behavior.

As sometimes I am better than a goldfish let us point to this old task from
3 yeas ago: https://github.com/odoo/odoo/commit/69a769fc9994d00060485703aa4307e2c8877fb7. This commit basically
reverts that one. It was linked to task ID 20996 that explainedwhy archive /
unarchive had to be used for leads as people don't understand won / lot for
leads.

This commit is linked to task ID 1880051 and PR #26977.
parent 1fea0f18
No related branches found
No related tags found
No related merge requests found
......@@ -45,14 +45,21 @@
<header>
<button name="%(crm.action_crm_lead2opportunity_partner)d" string="Convert to Opportunity" type="action"
help="Convert to Opportunity" class="oe_highlight" attrs="{'invisible': [('type', '=', 'opportunity')]}"/>
<button name="toggle_active"
string="Restore"
type="object"
attrs="{'invisible': ['|', ('probability', '&gt;', 0), ('active', '=', True)]}"/>
<button name="action_set_lost"
string="Mark as Lost"
type="object"
attrs="{'invisible': ['&amp;', ('probability', '=', 0), ('active', '=', False)]}"/>
</header>
<sheet>
<field name="active" invisible="1"/>
<div class="oe_button_box" name="button_box">
<button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive">
<field name="active" widget="boolean_button" options='{"terminology": "archive"}'/>
</button>
</div>
<div class="badge badge-success float-right" attrs="{'invisible': [('probability', '&lt;', 100)]}">Won</div>
<div class="badge-pill badge-danger float-right" attrs="{'invisible': ['|', ('probability', '&gt;', 0), ('active', '=', True)]}">Lost</div>
<div class="badge-pill badge-success float-right" attrs="{'invisible': [('probability', '&lt;', 100)]}">Won</div>
<div class="oe_title">
<label for="name" class="oe_edit_only" string="Lead"/>
<h1><field name="name" placeholder="Describe the lead..."/></h1>
......@@ -439,12 +446,17 @@
type="action" class="oe_highlight"
context="{'default_lead_id': active_id}"
attrs="{'invisible': [('active', '=', False),('probability', '&lt;', 100)]}"/>
<button name="toggle_active"
string="Restore"
type="object"
attrs="{'invisible': ['|', ('probability', '&gt;', 0), ('active', '=', True)]}"/>
<field name="stage_id" widget="statusbar"
options="{'clickable': '1', 'fold_field': 'fold'}"
domain="['|', ('team_id', '=', team_id), ('team_id', '=', False)]"
attrs="{'invisible': [('active', '=', False)]}"/>
</header>
<sheet>
<field name="active" invisible="1"/>
<div class="oe_button_box" name="button_box">
<button class="oe_stat_button" type="object"
context="{'partner_id': partner_id}"
......@@ -455,13 +467,9 @@
<span class="o_stat_text" attrs="{'invisible': [('meeting_count', '&gt;', 1)]}"> Meeting</span>
</div>
</button>
<button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive"
attrs="{'invisible': [('active', '=', True), ('probability', '&lt;', 100)]}">
<field name="active" widget="boolean_button" options='{"terminology": "archive"}'/>
</button>
</div>
<div class="badge badge-danger float-right" attrs="{'invisible': ['|', ('probability', '&gt;', 0), ('active', '=', True)]}">Lost</div>
<div class="badge badge-success float-right" attrs="{'invisible': [('probability', '&lt;', 100)]}">Won</div>
<div class="badge-pill badge-danger float-right" attrs="{'invisible': ['|', ('probability', '&gt;', 0), ('active', '=', True)]}">Lost</div>
<div class="badge-pill badge-success float-right" attrs="{'invisible': [('probability', '&lt;', 100)]}">Won</div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name" placeholder="e.g. Product Pricing"/></h1>
......
......@@ -7,7 +7,7 @@
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_case_form_view_leads" />
<field name="arch" type="xml">
<xpath expr="//button[@name='toggle_active']" position="before">
<xpath expr="//div[@name='button_box']" position="inside">
<button class="oe_stat_button" type="action" name="%(crm_lead_convert2task_action)d" icon="fa-bug" help="Convert to Task">
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">Convert To</span>
......
......@@ -17,7 +17,7 @@
'default_origin': name,
'default_source_id': source_id}"/>
</xpath>
<button name="toggle_active" position="before">
<button name="action_schedule_meeting" position="after">
<button class="oe_stat_button" type="action"
name="%(sale_action_quotations)d" icon="fa-pencil-square-o"
context="{'default_partner_id': partner_id, 'search_default_draft': 1}">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment