summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Kersten <jke@odoo.com>2017-01-31 16:02:49 +0100
committerJeremy Kersten <jke@odoo.com>2017-02-01 09:05:45 +0100
commit8de2ada34466b65b99406283667c63c4f855b56f (patch)
tree8a74eae8c0acf99ec9e9f703fe88fa51c414d410
parentce584f756af0040df6f4817638d50d1cd9ebfb66 (diff)
[FIX] website_crm_partner_assign: fix filter domain
Before this commit, lost was always empty because we didn't look for unactive record. All is replaced by Active (All without lost) ...
-rw-r--r--addons/website_crm_partner_assign/controllers/main.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/addons/website_crm_partner_assign/controllers/main.py b/addons/website_crm_partner_assign/controllers/main.py
index 3d71c31b300..9edc425e69a 100644
--- a/addons/website_crm_partner_assign/controllers/main.py
+++ b/addons/website_crm_partner_assign/controllers/main.py
@@ -94,13 +94,13 @@ class WebsiteAccount(website_account):
this_week_end_date = fields.Date.to_string(fields.Date.from_string(today) + datetime.timedelta(days=7))
searchbar_filters = {
- 'all': {'label': _('All'), 'domain': []},
+ 'all': {'label': _('Active'), 'domain': []},
'today': {'label': _('Today Activities'), 'domain': [('activity_date_deadline', '=', today)]},
'week': {'label': _('This Week Activities'),
'domain': [('activity_date_deadline', '>=', today), ('activity_date_deadline', '<=', this_week_end_date)]},
'overdue': {'label': _('Overdue Activities'), 'domain': [('activity_date_deadline', '<', today)]},
- 'won': {'label': _('Won'), 'domain': [('stage_id.probability', '=', 100), ('stage_id.fold', '=', True)]},
- 'lost': {'label': _('Lost'), 'domain': [('active', '=', False)]},
+ 'won': {'label': _('Won'), 'domain': [('stage_id.probability', '=', 100), ('stage_id.on_change', '=', True)]},
+ 'lost': {'label': _('Lost'), 'domain': [('active', '=', False), ('probability', '=', 0)]},
}
searchbar_sortings = {
'date': {'label': _('Newest'), 'order': 'create_date desc'},
@@ -119,6 +119,8 @@ class WebsiteAccount(website_account):
if not filterby:
filterby = 'all'
domain += searchbar_filters[filterby]['domain']
+ if filterby == 'lost':
+ CrmLead = CrmLead.with_context(active_test=False)
# archive groups - Default Group By 'create_date'
archive_groups = self._get_archive_groups('crm.lead', domain)