[FIX] website: Delete redirections if website is deleted

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) <jke@openerp.com>
This commit is contained in:
Jairo Llopis
2019-07-24 10:16:43 +00:00
parent bdfed67504
commit 21ede5365a
+1 -1
View File
@@ -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)