[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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user