From 21ede5365a059ea974ab67b40a158b2fe66765ed Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 24 Jul 2019 08:07:47 +0000 Subject: [FIX] website: Delete redirections if website is deleted MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this patch, if a website is deleted, its redirections will stay, affecting other websites. Now, website-specific redirections will disappear along with their corresponding website. closes odoo/odoo#35130 Signed-off-by: Jérémy Kersten (jke) --- addons/website/models/website.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/website/models/website.py') diff --git a/addons/website/models/website.py b/addons/website/models/website.py index 95565febaee..2d267a489dc 100644 --- a/addons/website/models/website.py +++ b/addons/website/models/website.py @@ -913,6 +913,6 @@ class WebsiteRedirect(models.Model): type = fields.Selection([('301', 'Moved permanently'), ('302', 'Moved temporarily')], string='Redirection Type', default='301') url_from = fields.Char('Redirect From') url_to = fields.Char('Redirect To') - website_id = fields.Many2one('website', 'Website') + website_id = fields.Many2one('website', 'Website', ondelete='cascade') active = fields.Boolean(default=True) sequence = fields.Integer(default=0) -- cgit v1.2.3