From 4385ed024e9ce9bfa9f733c30cc163d2f10bfd60 Mon Sep 17 00:00:00 2001 From: ryv-odoo Date: Fri, 29 Nov 2019 12:46:24 +0000 Subject: [PATCH] [REM] mail: remove leftover mail alias fields from res.users MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A mail alias is still linked with the res.users model with 2 fields, alias_id and alias_contact (related). It is not used anymore. We can therefore remove those fields. Aliases were added at 052f2ace57e20f06980bc8fadf37b32be1921420 . Purpose was to be able to discuss with users directly using Odoo as a mailbox. However it was not usable and was quickly deactivated. Aliases on res.users was removed at 029d1baf359eabb7ed531287f3cb2b3b8d586d39 . It was decided at that time to not support alias on users anymore as it was creating more issues than adding communication facility. This commit finally removes the unused fields. If necessary in some custom flow they can always be added through studio. LINKS Task ID 1919277 Community PR odoo/odoo#41160 Enterprise PR odoo/enterprise#6983 Upgrade PR odoo/upgrade#872 Co-Authored-By: Rémy Voet Co-Authored-By: Thibault Delavallée --- addons/mail/models/res_users.py | 9 ++------- addons/mail/views/res_users_views.xml | 4 ---- addons/mail_bot/views/res_users_views.xml | 2 +- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/addons/mail/models/res_users.py b/addons/mail/models/res_users.py index 58037fe43b8..64e0d1cd746 100644 --- a/addons/mail/models/res_users.py +++ b/addons/mail/models/res_users.py @@ -18,11 +18,6 @@ class Users(models.Model): _inherit = ['res.users'] _description = 'Users' - alias_id = fields.Many2one('mail.alias', 'Alias', ondelete="set null", required=False, - help="Email address internally associated with this user. Incoming "\ - "emails will appear in the user's notifications.", copy=False, auto_join=True) - alias_contact = fields.Selection( - string='Alias Contact Security', related='alias_id.alias_contact', readonly=False) notification_type = fields.Selection([ ('email', 'Handle by Emails'), ('inbox', 'Handle in Odoo')], @@ -64,8 +59,8 @@ GROUP BY channel_moderator.res_users_id""", [tuple(self.ids)]) def __init__(self, pool, cr): """ Override of __init__ to add access rights on notification_email_send - and alias fields. Access rights are disabled by default, but allowed - on some specific fields defined in self.SELF_{READ/WRITE}ABLE_FIELDS. + fields. Access rights are disabled by default, but allowed on some + specific fields defined in self.SELF_{READ/WRITE}ABLE_FIELDS. """ init_res = super(Users, self).__init__(pool, cr) # duplicate list to avoid modifying the original reference diff --git a/addons/mail/views/res_users_views.xml b/addons/mail/views/res_users_views.xml index c2d3d9ce825..f402858a1b5 100644 --- a/addons/mail/views/res_users_views.xml +++ b/addons/mail/views/res_users_views.xml @@ -26,10 +26,6 @@ - - - - diff --git a/addons/mail_bot/views/res_users_views.xml b/addons/mail_bot/views/res_users_views.xml index f82b2b96f72..36bb1abf22c 100644 --- a/addons/mail_bot/views/res_users_views.xml +++ b/addons/mail_bot/views/res_users_views.xml @@ -21,7 +21,7 @@ - +