From 92b176e89c4261bc7cc3b502eab8d308189b3e40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 30 Mar 2020 11:36:52 +0000 Subject: [PATCH] [FIX] maintenance: do not create random aliases PURPOSE Make aliases usage more unique, prevent re-using bounce or catchall aliases and remove auto-uniqueness of aliases. SPECIFICATION Remove automatic aliases creation. Aliases should be created on demand with real emails owned by users, not hidden in creation. Task ID 2160070 --- addons/maintenance/models/maintenance.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/maintenance/models/maintenance.py b/addons/maintenance/models/maintenance.py index c2f67db0412..4b8598796f4 100644 --- a/addons/maintenance/models/maintenance.py +++ b/addons/maintenance/models/maintenance.py @@ -64,8 +64,6 @@ class MaintenanceEquipmentCategory(models.Model): @api.model def create(self, vals): self = self.with_context(alias_model_name='maintenance.request', alias_parent_model_name=self._name) - if not vals.get('alias_name'): - vals['alias_name'] = vals.get('name') category_id = super(MaintenanceEquipmentCategory, self).create(vals) category_id.alias_id.write({'alias_parent_thread_id': category_id.id, 'alias_defaults': {'category_id': category_id.id}}) return category_id