From 103583192bec1df3ebb21e57002f5737a56adc48 Mon Sep 17 00:00:00 2001 From: rolandojduartem Date: Tue, 1 Aug 2023 19:01:56 +0000 Subject: [PATCH] [FIX] website_sale: Fix access to partner from website sale When the user is not signed up, in the address tab of the cart, an error appears because this user does not have the access to the model l10n_latam.identification.type with 403 Forbidden. The model is accessed by [1] [2], therefore sudo is required to access the information of the partner. References: - [1] https://github.com/odoo/odoo/blob/600bd9c8/addons/website_sale/controllers/main.py#L1043 - [2] https://github.com/odoo/odoo/blob/600bd9c8/addons/l10n_latam_base/models/res_partner.py#L21 closes odoo/odoo#130455 Signed-off-by: Victor Feyens (vfe) --- addons/website_sale/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index 712e37ab976..95a380b6e3f 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -1040,7 +1040,7 @@ class WebsiteSale(http.Controller): data["vat"] = Partner.fix_eu_vat_number(country_id, data.get("vat")) partner_dummy = Partner.new(self._get_vat_validation_fields(data)) try: - partner_dummy.check_vat() + partner_dummy.sudo().check_vat() except ValidationError as exception: error["vat"] = 'error' error_message.append(exception.args[0])