[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) <vfe@odoo.com>
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user