[FIX] base_module_uninstall: ondelete cascade
Before this commit, whenever an ir_module_module that had been installed/uninstalled at least once would be unlinked, an Exception would be raised since the field module_id references an ir_module_module and it is a required field. This commit fixes this by adding an ondelete='cascade' to the field. Fixes #20720
This commit is contained in:
@@ -9,8 +9,11 @@ class BaseModuleUninstall(models.TransientModel):
|
||||
_description = "Module Uninstallation"
|
||||
|
||||
show_all = fields.Boolean()
|
||||
module_id = fields.Many2one('ir.module.module', string="Module", required=True,
|
||||
domain=[('state', 'in', ['installed', 'to upgrade', 'to install'])])
|
||||
module_id = fields.Many2one(
|
||||
'ir.module.module', string="Module", required=True,
|
||||
domain=[('state', 'in', ['installed', 'to upgrade', 'to install'])],
|
||||
ondelete='cascade'
|
||||
)
|
||||
module_ids = fields.Many2many('ir.module.module', string="Impacted modules",
|
||||
compute='_compute_module_ids')
|
||||
model_ids = fields.Many2many('ir.model', string="Impacted data models",
|
||||
|
||||
Reference in New Issue
Block a user