[FIX] test_mail: mutlicompany systray test
odoo/odoo#122354 added this test but didn't handle that other models might trigger systray activities. On June 12th, the test started failing because calendar has a "Pricing Discussion" demo calendar event on the 12th of every month. It probably would have also failed on the 3rd and 22nd which both have demo meetings for the admin. Fix by looking up specifically activities of the test model we're concerned with. closes odoo/odoo#124684 X-original-commit: 54dce61ef8fa97e18f0cf53d1f098af55e1210e9 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
This commit is contained in:
@@ -394,9 +394,12 @@ class TestMultiCompanySetup(MailCommon, TestRecipients):
|
||||
)
|
||||
test_records[0].activity_schedule("test_mail.mail_act_test_todo", user_id=user_admin.id)
|
||||
test_records[1].activity_schedule("test_mail.mail_act_test_todo", user_id=user_admin.id)
|
||||
res_all = user_admin.systray_get_activities()
|
||||
test_activity = next(
|
||||
a for a in user_admin.systray_get_activities()
|
||||
if a['model'] == 'mail.test.multi.company.with.activity'
|
||||
)
|
||||
self.assertEqual(
|
||||
res_all[0],
|
||||
test_activity,
|
||||
{
|
||||
"actions": [{"icon": "fa-clock-o", "name": "Summary"}],
|
||||
"icon": "/base/static/description/icon.png",
|
||||
@@ -410,9 +413,13 @@ class TestMultiCompanySetup(MailCommon, TestRecipients):
|
||||
"type": "activity",
|
||||
}
|
||||
)
|
||||
res_c2 = user_admin.with_context(allowed_company_ids=[self.company_2.id]).systray_get_activities()
|
||||
|
||||
test_activity = next(
|
||||
a for a in user_admin.with_context(allowed_company_ids=[self.company_2.id]).systray_get_activities()
|
||||
if a['model'] == 'mail.test.multi.company.with.activity'
|
||||
)
|
||||
self.assertEqual(
|
||||
res_c2[0],
|
||||
test_activity,
|
||||
{
|
||||
"actions": [{"icon": "fa-clock-o", "name": "Summary"}],
|
||||
"icon": "/base/static/description/icon.png",
|
||||
|
||||
Reference in New Issue
Block a user