From 2e51c2b5f47f087e0b0bc6d8551669fa57228f80 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Wed, 8 Mar 2023 15:19:05 +0000 Subject: [PATCH] [IMP] mail: Allow user deletion if linked to mail.activity Purpose ======= Currently the on_delete='restrict' implicit constraint prevents the user deletion in case it's linked to a mail.activity record. Set the on_delete attribute to 'cascade' as the record is not of any usage without the user anyway. Taskid: 3222941 Part-of: odoo/odoo#114656 --- addons/mail/models/mail_activity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/models/mail_activity.py b/addons/mail/models/mail_activity.py index fe7b0692a3d..57749642846 100644 --- a/addons/mail/models/mail_activity.py +++ b/addons/mail/models/mail_activity.py @@ -82,7 +82,7 @@ class MailActivity(models.Model): user_id = fields.Many2one( 'res.users', 'Assigned to', default=lambda self: self.env.user, - index=True, required=True) + index=True, required=True, ondelete='cascade') request_partner_id = fields.Many2one('res.partner', string='Requesting Partner') state = fields.Selection([ ('overdue', 'Overdue'),