From c4636fe71b1ff42fb6528f5cf1931ef1cd4a83ba Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 1 Apr 2020 14:13:30 +0000 Subject: [PATCH] [FIX] webiste: No company in website Settings Steps to reproduce the bug: - Module website is installed - Multi companies is set - Go to Website > Settings - Remove the company for the current website and save Bug: A traceback was raised opw:2228183 closes odoo/odoo#48839 X-original-commit: 2c27b9d100c1f3759bfe864f8ac78bc5c0436ecd Signed-off-by: Simon Goffin (sig) --- addons/website/models/website.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/models/website.py b/addons/website/models/website.py index 7a30ea3662b..3269e305e12 100644 --- a/addons/website/models/website.py +++ b/addons/website/models/website.py @@ -186,7 +186,7 @@ class Website(models.Model): public_user_to_change_websites = self.filtered(lambda w: w.sudo().user_id.company_id.id != values['company_id']) if public_user_to_change_websites: company = self.env['res.company'].browse(values['company_id']) - super(Website, public_user_to_change_websites).write(dict(values, user_id=company._get_public_user().id)) + super(Website, public_user_to_change_websites).write(dict(values, user_id=company and company._get_public_user().id)) result = super(Website, self - public_user_to_change_websites).write(values) if 'cdn_activated' in values or 'cdn_url' in values or 'cdn_filters' in values: