diff --git a/addons/account/tests/test_account_incoming_supplier_invoice.py b/addons/account/tests/test_account_incoming_supplier_invoice.py index 40fac722805..ac88ef5145b 100644 --- a/addons/account/tests/test_account_incoming_supplier_invoice.py +++ b/addons/account/tests/test_account_incoming_supplier_invoice.py @@ -12,8 +12,6 @@ class TestAccountIncomingSupplierInvoice(AccountTestInvoicingCommon): def setUpClass(cls, chart_template_ref=None): super().setUpClass(chart_template_ref=chart_template_ref) - cls.env['ir.config_parameter'].sudo().set_param('mail.catchall.domain', 'test.mycompany.com') - cls.internal_user = cls.env['res.users'].create({ 'name': 'Internal User', 'login': 'internal.user@test.odoo.com', diff --git a/addons/account/views/account_journal_dashboard_view.xml b/addons/account/views/account_journal_dashboard_view.xml index 96111a366f9..75a31af4c4a 100644 --- a/addons/account/views/account_journal_dashboard_view.xml +++ b/addons/account/views/account_journal_dashboard_view.xml @@ -12,7 +12,7 @@ - +
@@ -45,7 +45,7 @@ -
-
+
diff --git a/addons/account/views/account_journal_views.xml b/addons/account/views/account_journal_views.xml index f446d3490f7..926c055f575 100644 --- a/addons/account/views/account_journal_views.xml +++ b/addons/account/views/account_journal_views.xml @@ -143,18 +143,25 @@ - + - + - + diff --git a/addons/base_setup/models/res_config_settings.py b/addons/base_setup/models/res_config_settings.py index 32981b403fb..387b4a6cc5e 100644 --- a/addons/base_setup/models/res_config_settings.py +++ b/addons/base_setup/models/res_config_settings.py @@ -15,9 +15,6 @@ class ResConfigSettings(models.TransientModel): user_default_rights = fields.Boolean( "Default Access Rights", config_parameter='base_setup.default_user_rights') - external_email_server_default = fields.Boolean( - "Use Custom Email Servers", - config_parameter='base_setup.default_external_email_server') module_base_import = fields.Boolean("Allow users to import data from CSV/XLS/XLSX/ODS files") module_google_calendar = fields.Boolean( string='Allow the users to synchronize their calendar with Google Calendar') diff --git a/addons/crm/tests/common.py b/addons/crm/tests/common.py index 468f8cd46cc..053c8aaca71 100644 --- a/addons/crm/tests/common.py +++ b/addons/crm/tests/common.py @@ -265,6 +265,18 @@ class TestCrmCommon(TestSalesCommon, MailCase): 'email': 'company.2@test.example.com', 'name': 'New Test Company', }) + cls.alias_bounce_c2 = 'bounce.c2' + cls.alias_catchall_c2 = 'catchall.c2' + cls.alias_default_from_c2 = 'notifications.c2' + cls.alias_domain_c2_name = 'test.mycompany2.com' + cls.mail_alias_domain_c2 = cls.env['mail.alias.domain'].create({ + 'bounce_alias': cls.alias_bounce_c2, + 'catchall_alias': cls.alias_catchall_c2, + 'company_ids': [(4, cls.company_2.id)], + 'default_from': cls.alias_default_from_c2, + 'name': cls.alias_domain_c2_name, + 'sequence': 2, + }) cls.user_sales_manager_mc = mail_new_test_user( cls.env, diff --git a/addons/crm/tests/test_crm_lead_convert_mass.py b/addons/crm/tests/test_crm_lead_convert_mass.py index 0a3010fc3fa..0da42cebb26 100644 --- a/addons/crm/tests/test_crm_lead_convert_mass.py +++ b/addons/crm/tests/test_crm_lead_convert_mass.py @@ -42,7 +42,7 @@ class TestLeadConvertMass(crm_common.TestLeadConvertMassCommon): with self.assertQueryCount(user_sales_manager=0): test_leads = self.env['crm.lead'].browse(test_leads.ids) - with self.assertQueryCount(user_sales_manager=581): # crm 579 / com 581 / ent 581 + with self.assertQueryCount(user_sales_manager=583): # crm 543 / com 545 / ent 583 test_leads._handle_salesmen_assignment(user_ids=user_ids, team_id=team_id) self.assertEqual(test_leads.team_id, self.sales_team_convert) @@ -167,7 +167,7 @@ class TestLeadConvertMass(crm_common.TestLeadConvertMassCommon): user_ids = self.assign_users.ids # randomness: at least 1 query - with self.assertQueryCount(user_sales_manager=1800): # crm 1503 / com 1790 / ent 1798 + with self.assertQueryCount(user_sales_manager=1800): # crm 1503 / com 1790 / ent 1800 mass_convert = self.env['crm.lead2opportunity.partner.mass'].with_context({ 'active_model': 'crm.lead', 'active_ids': test_leads.ids, diff --git a/addons/crm/tests/test_crm_lead_notification.py b/addons/crm/tests/test_crm_lead_notification.py index 046271094c3..1ecc805ad86 100644 --- a/addons/crm/tests/test_crm_lead_notification.py +++ b/addons/crm/tests/test_crm_lead_notification.py @@ -14,6 +14,8 @@ class NewLeadNotification(TestCrmCommon): def setUpClass(cls): """ Activate some langs to test lang propagation in various mail flows """ super(NewLeadNotification, cls).setUpClass() + cls._activate_multi_company() + cls.test_email = '"Test Email" ' model_lang = cls.env['res.lang'].sudo().with_context(active_test=False) @@ -221,14 +223,14 @@ class NewLeadNotification(TestCrmCommon): @mute_logger('odoo.addons.mail.models.mail_thread') def test_new_lead_from_email_multicompany(self): company0 = self.env.company - company1 = self.env['res.company'].create({'name': 'new_company'}) + company1 = self.company_2 self.env.user.write({ 'company_ids': [(4, company0.id, False), (4, company1.id, False)], }) - crm_team_model = self.env['ir.model'].search([('model', '=', 'crm.team')]) - crm_lead_model = self.env['ir.model'].search([('model', '=', 'crm.lead')]) + crm_team_model_id = self.env['ir.model']._get_id('crm.team') + crm_lead_model_id = self.env['ir.model']._get_id('crm.lead') crm_team0 = self.env['crm.team'].create({ 'name': 'crm team 0', @@ -240,16 +242,18 @@ class NewLeadNotification(TestCrmCommon): }) mail_alias0 = self.env['mail.alias'].create({ + 'alias_domain_id': company0.alias_domain_id.id, 'alias_name': 'sale_team_0', - 'alias_model_id': crm_lead_model.id, - 'alias_parent_model_id': crm_team_model.id, + 'alias_model_id': crm_lead_model_id, + 'alias_parent_model_id': crm_team_model_id, 'alias_parent_thread_id': crm_team0.id, 'alias_defaults': "{'type': 'opportunity', 'team_id': %s}" % crm_team0.id, }) mail_alias1 = self.env['mail.alias'].create({ + 'alias_domain_id': company1.alias_domain_id.id, 'alias_name': 'sale_team_1', - 'alias_model_id': crm_lead_model.id, - 'alias_parent_model_id': crm_team_model.id, + 'alias_model_id': crm_lead_model_id, + 'alias_parent_model_id': crm_team_model_id, 'alias_parent_thread_id': crm_team1.id, 'alias_defaults': "{'type': 'opportunity', 'team_id': %s}" % crm_team1.id, }) @@ -257,12 +261,12 @@ class NewLeadNotification(TestCrmCommon): crm_team0.write({'alias_id': mail_alias0.id}) crm_team1.write({'alias_id': mail_alias1.id}) - new_message0 = """MIME-Version: 1.0 + new_message0 = f"""MIME-Version: 1.0 Date: Thu, 27 Dec 2018 16:27:45 +0100 Message-ID: Subject: sale team 0 in company 0 From: A client -To: sale_team_0@test.mycompany.com +To: {mail_alias0.display_name} Content-Type: multipart/alternative; boundary="000000000000a47519057e029630" --000000000000a47519057e029630 @@ -278,12 +282,12 @@ Content-Transfer-Encoding: quoted-printable --000000000000a47519057e029630-- """ - new_message1 = """MIME-Version: 1.0 + new_message1 = f"""MIME-Version: 1.0 Date: Thu, 27 Dec 2018 16:27:45 +0100 Message-ID: Subject: sale team 1 in company 1 From: B client -To: sale_team_1@test.mycompany.com +To: {mail_alias1.display_name} Content-Type: multipart/alternative; boundary="000000000000a47519057e029630" --000000000000a47519057e029630 diff --git a/addons/crm/tests/test_performances.py b/addons/crm/tests/test_performances.py index acc771fc3ef..6b15d99a402 100644 --- a/addons/crm/tests/test_performances.py +++ b/addons/crm/tests/test_performances.py @@ -178,7 +178,7 @@ class TestLeadAssignPerf(TestLeadAssignCommon): # randomness: add 2 queries with self.with_user('user_sales_manager'): - with self.assertQueryCount(user_sales_manager=6066): # crm 6048 / com 6052 / ent 6054 + with self.assertQueryCount(user_sales_manager=6066): # crm 6048 / com 6052 / ent 6055 self.env['crm.team'].browse(sales_teams.ids)._action_assign_leads(work_days=30) # teams assign diff --git a/addons/crm/views/crm_team_views.xml b/addons/crm/views/crm_team_views.xml index 08620447bfd..2645aad2e09 100644 --- a/addons/crm/views/crm_team_views.xml +++ b/addons/crm/views/crm_team_views.xml @@ -159,18 +159,13 @@