From 11def7563ee998b8da2abc8ffacb15a2f594ec6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 25 Oct 2021 15:32:01 +0200 Subject: [PATCH] [IMP] base_setup, mail, hr: allow to configure company alias domains PURPOSE Allow alias domains to be multiple, notably to be used in a multi company environment where each company has its own alias domain. SPECIFICATIONS Update settings to configure your company's current alias domain instead of the global 'alias.catchall.domain' configuration parameter. As domain configuration is globally done per company, this is now a related on the company. Advanced configuration and management can still be done manually in settings. Field 'external_email_server_default' triggering display of mail configuration is moved to mail. It is defined in 'base_setup' but used only in mail hence moving the field to be coherent. Task-36879 (Mail: Support Multi Domains Aliases) Part-of: odoo/odoo#76734 --- addons/base_setup/models/res_config_settings.py | 3 --- .../views/res_config_settings_views.xml | 11 ++++++----- addons/mail/models/res_config_settings.py | 8 ++++++-- addons/mail/views/res_config_settings_views.xml | 16 ++++++++++++---- 4 files changed, 24 insertions(+), 14 deletions(-) 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/hr_expense/views/res_config_settings_views.xml b/addons/hr_expense/views/res_config_settings_views.xml index 45e108356c5..a0f5a714729 100644 --- a/addons/hr_expense/views/res_config_settings_views.xml +++ b/addons/hr_expense/views/res_config_settings_views.xml @@ -14,18 +14,19 @@ help="Create expenses from incoming emails" title="Send an email to this email alias with the receipt in attachment to create an expense in one click. If the first word of the mail subject contains the category's internal reference or the category name, the corresponding category will automatically be set. Type the expense amount in the mail subject to set it on the expense too."> -
-
+
+
-
+
diff --git a/addons/mail/models/res_config_settings.py b/addons/mail/models/res_config_settings.py index 470200d2532..c57b86d15e3 100644 --- a/addons/mail/models/res_config_settings.py +++ b/addons/mail/models/res_config_settings.py @@ -12,9 +12,13 @@ class ResConfigSettings(models.TransientModel): the alias domain. """ _inherit = 'res.config.settings' + external_email_server_default = fields.Boolean( + "Use Custom Email Servers", + config_parameter='base_setup.default_external_email_server') fail_counter = fields.Integer('Fail Mail', compute="_compute_fail_counter") - alias_domain = fields.Char( - 'Alias Domain', config_parameter='mail.catchall.domain', + alias_domain_id = fields.Many2one( + 'mail.alias.domain', 'Alias Domain', + readonly=False, related='company_id.alias_domain_id', help="If you have setup a catch-all email domain redirected to the Odoo server, enter the domain name here.") module_google_gmail = fields.Boolean('Support Gmail Authentication') module_microsoft_outlook = fields.Boolean('Support Outlook Authentication') diff --git a/addons/mail/views/res_config_settings_views.xml b/addons/mail/views/res_config_settings_views.xml index 767acd38c3e..ddb40d0ae2a 100644 --- a/addons/mail/views/res_config_settings_views.xml +++ b/addons/mail/views/res_config_settings_views.xml @@ -33,7 +33,18 @@
- + + @ + + +
Save this page and come back here to set up the feature.
@@ -51,9 +62,6 @@
- - @ -