[FIX] website_sale: delete child category on parent
In the case of deletion with `ondelete="set null"`, return_path of children of deleted record will not have return_path updated. So remove the children recursively. Another fix was done in 13.0 to avoid most issue in 6d5cd8b1d19. opw-2148046 closes #41075 closes odoo/odoo#41178 X-original-commit: 6d5cd8b1d194fb173c486355c89d2ce503fd0ba4 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
This commit is contained in:
@@ -138,7 +138,7 @@ class ProductPublicCategory(models.Model):
|
||||
_order = "sequence, name"
|
||||
|
||||
name = fields.Char(required=True, translate=True)
|
||||
parent_id = fields.Many2one('product.public.category', string='Parent Category', index=True)
|
||||
parent_id = fields.Many2one('product.public.category', string='Parent Category', index=True, ondelete="cascade")
|
||||
parent_path = fields.Char(index=True)
|
||||
child_id = fields.One2many('product.public.category', 'parent_id', string='Children Categories')
|
||||
parents_and_self = fields.Many2many('product.public.category', compute='_compute_parents_and_self')
|
||||
|
||||
Reference in New Issue
Block a user