[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
This commit is contained in:
Yannick Tivisse
2023-03-13 13:13:48 +01:00
parent d8c9c8d10b
commit 2e51c2b5f4
+1 -1
View File
@@ -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'),