Skip to content

Commit

Permalink
[FIX] sales_team, crm: expected closing
Browse files Browse the repository at this point in the history
On the CRM dashboard, the shortcut 'exp. closing' is the same than the
'overdue' shortcut. However, the number of opportunities in these
categories is computed differently (see method
`retrieve_sales_dashboard`).

We introduce a new filter "Overdue Opportunities" which reflects this
difference.

opw-704173
  • Loading branch information
nim-odoo committed Feb 2, 2017
1 parent 5bd8957 commit 27b6451
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions addons/crm/views/crm_lead_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,9 @@
<filter string="Overdue Activities" name="overdue"
domain="[('date_action', '&lt;', context_today().strftime('%Y-%m-%d'))]"
help="Show all opportunities for which the next action date is before today"/>
<filter string="Overdue Opportunities" name="overdue_opp"
domain="[('date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
help="Show all opportunities with a deadline for which the next action date is before today"/>
<separator/>
<filter string="Unread Messages" name="message_needaction" domain="[('message_needaction','=',True)]"/>
<filter string="Lost" domain="[('active', '=', False)]"/>
Expand Down
2 changes: 2 additions & 0 deletions addons/sales_team/static/src/js/sales_team_dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ var SalesTeamDashboardView = KanbanView.extend({
} else if (action_name === 'crm.action_your_pipeline') {
if (action_extra === 'overdue') {
additional_context['search_default_overdue'] = 1;
} else if (action_extra === 'overdue_opp') {
additional_context['search_default_overdue_opp'] = 1;
}
} else if (action_name === 'crm.crm_opportunity_report_action_graph') {
additional_context.search_default_won = 1;
Expand Down
2 changes: 1 addition & 1 deletion addons/sales_team/static/src/xml/sales_team_dashboard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
</a>
</td>
<td t-if="show_demo or (values and values['closing']['overdue'] != 0)" class="o_warning" title="To Opportunities">
<a href="#" class="o_dashboard_action" name="crm.action_your_pipeline" data-extra="overdue">
<a href="#" class="o_dashboard_action" name="crm.action_your_pipeline" data-extra="overdue_opp">
<t t-if="!show_demo">
<t t-esc="values['closing']['overdue']"/> exp. closing
</t>
Expand Down

0 comments on commit 27b6451

Please sign in to comment.