[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:
Martin Geubelle
2018-01-31 14:12:53 +01:00
parent 897b84b37b
commit 5d463d2c03
+1 -1
View File
@@ -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='')