[FIX] base: correctly delete required many2one
In the transient model 'Change Password Wizard User', the many2one
`wizard_id` was not set as ondelete cascade even though this field was
required.
This was causing issues in the auto-vacuum cron if by chance this model
was cleaned up before the wizard ('Change Password Wizard').
Courtesy of @rco-odoo
Issue #813289
This commit is contained in:
@@ -954,7 +954,7 @@ class ChangePasswordUser(models.TransientModel):
|
||||
_name = 'change.password.user'
|
||||
_description = 'Change Password Wizard User'
|
||||
|
||||
wizard_id = fields.Many2one('change.password.wizard', string='Wizard', required=True)
|
||||
wizard_id = fields.Many2one('change.password.wizard', string='Wizard', required=True, ondelete='cascade')
|
||||
user_id = fields.Many2one('res.users', string='User', required=True, ondelete='cascade')
|
||||
user_login = fields.Char(string='User Login', readonly=True)
|
||||
new_passwd = fields.Char(string='New Password', default='')
|
||||
|
||||
Reference in New Issue
Block a user