[REF] crm: remove archive-related filters

Purpose of this commit is to remove filters and actions linked to archive
and restore.

Won / Lost filters are sufficient now as archive behavior has been removed.

Using the newly-introduced archivable option in kanban view we now hide the
archive / restore buttons present in the columns of leads kanban view. Indeed
people should go through the mark as won / mark as lost flow and not use the
archive feature.

In kanban view actions in vignette dropdown are also removed.

Finally some dead action code can now be removed.

This commit is linked to task ID 1880051 and PR #26977.
This commit is contained in:
Thibault Delavallée
2018-09-21 11:22:01 +02:00
parent 81782e680a
commit 9e430e9bc3
3 changed files with 4 additions and 16 deletions
-8
View File
@@ -354,14 +354,6 @@ class Lead(models.Model):
""" Lost semantic: probability = 0, active = False """
return self.write({'probability': 0, 'active': False})
@api.multi
def action_set_active(self):
return self.write({'active': True})
@api.multi
def action_set_unactive(self):
return self.write({'active': False})
@api.multi
def action_set_won(self):
""" Won semantic: probability = 100 (active untouched) """
@@ -75,9 +75,6 @@
<filter string="Creation Date" name="filter_create_date" date="create_date"/>
<filter string="Expected Closing" name="filter_date_deadline" date="date_deadline"/>
<filter string="Date Closed" name="date_closed_filter" date="date_closed"/>
<separator/>
<filter string="Current" name="current" domain="[('active', '=', True)]"/>
<filter string="Archived" name="archived" domain="[('active', '=', False)]"/>
<group expand="0" string="Extended Filters">
<field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/>
<field name="stage_id" widget="selection" domain="['|', ('team_id', '=', False), ('team_id', '=', 'team_id')]"/>
+4 -5
View File
@@ -176,7 +176,7 @@
<field name="model">crm.lead</field>
<field name="priority" eval="100"/>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<kanban class="o_kanban_mobile" archivable="false">
<field name="name"/>
<field name="contact_name"/>
<field name="priority"/>
@@ -313,7 +313,8 @@
<field name="model">crm.lead</field>
<field name="priority" eval="1"/>
<field name="arch" type="xml">
<kanban default_group_by="stage_id" class="o_kanban_small_column o_opportunity_kanban" on_create="quick_create" quick_create_view="crm.quick_create_opportunity_form">
<kanban default_group_by="stage_id" class="o_kanban_small_column o_opportunity_kanban" on_create="quick_create" quick_create_view="crm.quick_create_opportunity_form"
archivable="false">
<field name="stage_id" options='{"group_by_tooltip": {"requirements": "Description", "legend_priority": "Use of stars"}}'/>
<field name="color"/>
<field name="priority"/>
@@ -342,8 +343,6 @@
<div class="dropdown-menu" role="menu">
<t t-if="widget.editable"><a role="menuitem" type="edit" class="dropdown-item">Edit</a></t>
<t t-if="widget.deletable"><a role="menuitem" type="delete" class="dropdown-item">Delete</a></t>
<a t-if="! record.active.value" role="menuitem" name="action_set_active" type="object" class="dropdown-item">Restore</a>
<a t-if="record.active.value" role="menuitem" name="action_set_unactive" type="object" class="dropdown-item">Archive</a>
<ul class="oe_kanban_colorpicker" data-field="color"/>
</div>
</div>
@@ -407,7 +406,7 @@
<filter string="Won" name="won"
domain="[('probability', '=', 100)]"/>
<filter string="Lost" name="lost"
domain="[('probability', '=', 0), ('active', '=', False)]"/>
domain="['&amp;', ('probability', '=', 0), ('active', '=', False)]"/>
<group expand="0" string="Group By">
<filter string="Salesperson" name="salesperson" context="{'group_by':'user_id'}"/>
<filter string="Sales Channel" name="saleschannel" context="{'group_by':'team_id'}"/>