summaryrefslogtreecommitdiff
path: root/addons/website_crm_partner_assign/controllers/main.py
diff options
context:
space:
mode:
authorDavid Beguin <dbe@odoo.com>2019-05-22 08:56:36 +0000
committerDavid Beguin <dbe@odoo.com>2019-06-11 07:04:33 +0000
commit8e540558ee1670dc32f00c6fc8cbb04838b4b972 (patch)
tree84967bc26ccb8fa0296b5ff46edad2fed1301810 /addons/website_crm_partner_assign/controllers/main.py
parentf60825b43979345b456510db25f70264a93cbdb0 (diff)
[IMP-REM] crm, * : remove stage based probability and add won_stage bool field on crm.stage
This commit prepares the next Predictive Lead Scoring (aka PLS) ones. With the new PLS implementation, stage based probablility is not relevant anymore as the probability will be computed based on multiple criteria following the Naive Bayes probabilist theorem. To determine if the stage is a won stage, a new 'won_stage' boolean field replaces the old probability field that is now removed. won_stage = True is equivalent to stage.probability = 100. Task ID : 1925439 PR #33589
Diffstat (limited to 'addons/website_crm_partner_assign/controllers/main.py')
-rw-r--r--addons/website_crm_partner_assign/controllers/main.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/website_crm_partner_assign/controllers/main.py b/addons/website_crm_partner_assign/controllers/main.py
index 429e8f9d822..3acffdacd50 100644
--- a/addons/website_crm_partner_assign/controllers/main.py
+++ b/addons/website_crm_partner_assign/controllers/main.py
@@ -102,7 +102,7 @@ class WebsiteAccount(CustomerPortal):
'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.on_change', '=', True)]},
+ 'won': {'label': _('Won'), 'domain': [('stage_id.is_won', '=', True)]},
'lost': {'label': _('Lost'), 'domain': [('active', '=', False), ('probability', '=', 0)]},
}
searchbar_sortings = {
@@ -170,7 +170,7 @@ class WebsiteAccount(CustomerPortal):
"website_crm_partner_assign.portal_my_opportunity", {
'opportunity': opp,
'user_activity': opp.sudo().activity_ids.filtered(lambda activity: activity.user_id == request.env.user)[:1],
- 'stages': request.env['crm.stage'].search([('probability', '!=', '100')], order='sequence desc, name desc, id desc'),
+ 'stages': request.env['crm.stage'].search([('is_won', '!=', True)], order='sequence desc, name desc, id desc'),
'activity_types': request.env['mail.activity.type'].sudo().search([]),
'states': request.env['res.country.state'].sudo().search([]),
'countries': request.env['res.country'].sudo().search([]),