From ae095de3666a1ee00a743478e052358a4fed8934 Mon Sep 17 00:00:00 2001 From: "Anh Thao Pham (pta)" Date: Thu, 29 Oct 2020 11:09:01 +0000 Subject: [PATCH] [FIX] website_sale: fix AccessError when checking fiscal position An AccessError can be raised when checking Fiscal Position of user's last order if connected user belongs to a different company than the company of the order. opw-2370903 closes odoo/odoo#61022 X-original-commit: 1b602c1fef0f2d05c94a9547e203ae8ecd24e87b Signed-off-by: Toufik Benjaa (tbe) Signed-off-by: Anh Thao PHAM --- addons/website_sale/models/website.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_sale/models/website.py b/addons/website_sale/models/website.py index 877a4afa82a..f3aff71c14c 100644 --- a/addons/website_sale/models/website.py +++ b/addons/website_sale/models/website.py @@ -261,7 +261,7 @@ class Website(models.Model): # Do not reload the cart of this user last visit if the Fiscal Position has changed. if check_fpos and sale_order: fpos_id = ( - self.env['account.fiscal.position'] + self.env['account.fiscal.position'].sudo() .with_company(sale_order.company_id.id) .get_fiscal_position(sale_order.partner_id.id, delivery_id=sale_order.partner_shipping_id.id) )