From 0dd38282c356a78652db3c65248b8512d8f1d246 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Thu, 17 Jan 2019 12:53:08 +0000 Subject: [PATCH] [FIX] crm: test lead from email needs second company Because of a742813c36fc8cdf4e41c72e00944b6901be6017. Apparently when crm is installed alone, there is only one company closes odoo/odoo#30312 --- addons/crm/tests/test_new_lead_notification.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/crm/tests/test_new_lead_notification.py b/addons/crm/tests/test_new_lead_notification.py index 7335dafa17e..16228fcc55c 100644 --- a/addons/crm/tests/test_new_lead_notification.py +++ b/addons/crm/tests/test_new_lead_notification.py @@ -43,10 +43,9 @@ class NewLeadNotification(TestCrmCases): self.assertTrue(lead_user.message_needaction) def test_new_lead_from_email_multicompany(self): - companies = self.env['res.company'].search([]) + company0 = self.env.user.company_id + company1 = self.env['res.company'].create({'name': 'new_company'}) - company0 = companies[0] - company1 = companies[1] self.env.user.write({ 'company_ids': [(4, company0.id, False), (4, company1.id, False)], })