[FIX] website_portal: portal user don't have access to website.company_id

Avoid portal user to receive 403 when trying to edit vat code on /my/account
There are no risk to read field in sudo in this case.

opw-740314
This commit is contained in:
Jeremy Kersten
2017-04-25 10:56:34 +02:00
parent 83ec253b78
commit d5384f8f9d
+1 -1
View File
@@ -105,7 +105,7 @@ class website_account(http.Controller):
# vat validation
if data.get("vat") and hasattr(request.env["res.partner"], "check_vat"):
if request.website.company_id.vat_check_vies:
if request.website.company_id.sudo().vat_check_vies:
# force full VIES online check
check_func = request.env["res.partner"].vies_vat_check
else: