[IMP] {sale_}crm: tone down action buttons on lead/opp form view

Primary action buttons should suggest the next logical flow to the user.
On contrary, the opportunity form view is having too many primary
buttons, losing their actual meaning.

In this case we consider that next logical steps should be:
 - the creation of a new commercial document (Sale / Rental) if
   any / all of those apps are installed;
 - the winning of the deal (as losing would stop the flow);

With this commit, we make following changes to achieve that:
 - rename the 'Mark Lost' and 'Mark as Lost' buttons to simply 'Lost'
   and make them secondary buttons;
 - rename the 'Mark Won' button to simply 'Won', and keep it primary;
 - once the 'sale_crm' is installed, make the 'Won' button secondary;

closes odoo/odoo#64834

Task-id: 2247355
Related: odoo/enterprise#15977
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
ijas ahammed
2021-01-28 11:45:53 +00:00
committed by Dharmraj Jhala
parent 64e0ee442f
commit bd830b35a7
2 changed files with 7 additions and 4 deletions
+4 -4
View File
@@ -6,16 +6,16 @@
<field name="arch" type="xml">
<form class="o_lead_opportunity_form" js_class="crm_form">
<header>
<button name="action_set_won_rainbowman" string="Mark Won"
<button name="action_set_won_rainbowman" string="Won"
type="object" class="oe_highlight"
attrs="{'invisible': ['|','|', ('active','=',False), ('probability', '=', 100), ('type', '=', 'lead')]}"/>
<button name="%(crm.crm_lead_lost_action)d" string="Mark Lost"
type="action" class="oe_highlight" context="{'default_lead_id': active_id}" attrs="{'invisible': ['|', ('type', '=', 'lead'),('active', '=', False),('probability', '&lt;', 100)]}"/>
<button name="%(crm.crm_lead_lost_action)d" string="Lost"
type="action" context="{'default_lead_id': active_id}" attrs="{'invisible': ['|', ('type', '=', 'lead'),('active', '=', False),('probability', '&lt;', 100)]}"/>
<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'), ('active', '=', False)]}"/>
<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"
<button name="action_set_lost" string="Lost" type="object"
attrs="{'invisible': ['|', ('type', '=', 'opportunity'), '&amp;', ('probability', '=', 0), ('active', '=', False)]}"/>
<field name="stage_id" widget="statusbar"
options="{'clickable': '1', 'fold_field': 'fold'}"
+3
View File
@@ -10,6 +10,9 @@
<button string="New Quotation" name="action_sale_quotations_new" type="object" class="oe_highlight"
attrs="{'invisible': ['|', ('type', '=', 'lead'), '&amp;', ('probability', '=', 0), ('active', '=', False)]}"/>
</xpath>
<button name="action_set_won_rainbowman" position="attributes">
<attribute name="class" remove="oe_highlight"/>
</button>
<button name="action_schedule_meeting" position="after">
<button class="oe_stat_button" type="object"
name="action_view_sale_quotation" icon="fa-pencil-square-o" attrs="{'invisible': [('type', '=', 'lead')]}">