[FIX] portal: allow to delete res.partner
Do these steps: 1. Create a partner. 2. Grant him portal access through *Actions > Portal Access Management*. 3. Delete the created user. 4. Delete the partner. You will get this error: ``` Odoo Warning - Validation Error The operation cannot be completed, probably due to the following: - deletion: you may be trying to delete a record while other records still reference it - creation/update: a mandatory field is not correctly set [object with reference: Portal User Config - portal.wizard.user] ``` This happens because the wizard (which is a transient model) does not let the partner to be deleted. With this patch, we avoid that bug. Closes #12608
This commit is contained in:
parent
20ba16e777
commit
000d8eba12
|
@ -117,7 +117,9 @@ class wizard_user(osv.osv_memory):
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'wizard_id': fields.many2one('portal.wizard', string='Wizard', required=True, ondelete='cascade'),
|
'wizard_id': fields.many2one('portal.wizard', string='Wizard', required=True, ondelete='cascade'),
|
||||||
'partner_id': fields.many2one('res.partner', string='Contact', required=True, readonly=True),
|
'partner_id': fields.many2one(
|
||||||
|
'res.partner', string='Contact', required=True, readonly=True,
|
||||||
|
ondelete='cascade'),
|
||||||
'email': fields.char(string='Email', size=240),
|
'email': fields.char(string='Email', size=240),
|
||||||
'in_portal': fields.boolean('In Portal'),
|
'in_portal': fields.boolean('In Portal'),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue