diff options
| author | Jérémy Hennecart <jeh@odoo.com> | 2020-09-21 09:54:34 +0000 |
|---|---|---|
| committer | Jérémy Hennecart <jeh@odoo.com> | 2020-11-16 10:33:36 +0000 |
| commit | c5059aa151430eebd62e9f000fe43e87bdd89ff3 (patch) | |
| tree | 6925f6d79aa47a0c10df71caf06a743936a0168c /addons/website_crm_partner_assign/tests | |
| parent | b3415d9dd0bcc1053e47b8a0082c772ca4a8220f (diff) | |
[FIX] website_crm_partner_assign: fix condition to assign salesman
The first stage has not always its sequence equal to 1. So if the
probability was for example equal to 0, then the salesman will not
be set to the new lead.
Since when we create a lead, the default stage is the first one in
the sequence. We only need to check if the lead is not already won
when we create a lead and try to assign the salesman to it.
task-2329327
closes odoo/odoo#58153
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/website_crm_partner_assign/tests')
| -rw-r--r-- | addons/website_crm_partner_assign/tests/test_partner_assign.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/addons/website_crm_partner_assign/tests/test_partner_assign.py b/addons/website_crm_partner_assign/tests/test_partner_assign.py index 5869baf7dc1..bc0ad24fad7 100644 --- a/addons/website_crm_partner_assign/tests/test_partner_assign.py +++ b/addons/website_crm_partner_assign/tests/test_partner_assign.py @@ -149,13 +149,9 @@ class TestPartnerLeadPortal(TestCrmCommon): 'contact_name': 'Renaud Rutten', }) opportunity = self.env['crm.lead'].browse(data['id']) - # TDE FIXME - # This test crashed depending on group_use_lead configuration as default team - # depends on a default_type that is not propagated but computed separately. - # Solving it require some cleaning in crm models, like removing onchanges / default to compute - # salesmanteam = self.env['crm.team']._get_default_team_id(user_id=self.user_portal.user_id.id) + salesmanteam = self.env['crm.team']._get_default_team_id(user_id=self.user_portal.user_id.id) - # self.assertEqual(opportunity.team_id, salesmanteam, 'The created opportunity should have the same team as the salesman default team of the opportunity creator.') + self.assertEqual(opportunity.team_id, salesmanteam, 'The created opportunity should have the same team as the salesman default team of the opportunity creator.') self.assertEqual(opportunity.partner_assigned_id, self.user_portal.partner_id, 'Assigned Partner of created opportunity is the (portal) creator.') def test_portal_mixin_url(self): |
