From 9b3b295d28a98397e7645d2cb064a2b8a18563d7 Mon Sep 17 00:00:00 2001 From: Florent de Labarre Date: Tue, 27 Jul 2021 14:19:59 +0000 Subject: [PATCH] [FIX] point_of_sale: impossible to print sale details If you a user with only group 'group_pos_user' it is not possible to print the sale details. Because during the compute_all of the taxe, account.account.tag need read access. This PR allow 'group_pos_user' to print the sale details. closes odoo/odoo#74749 X-original-commit: 9212ee2a79189802ae9a7cbc7a8446e71b2b215a Signed-off-by: pimodoo --- addons/point_of_sale/models/pos_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py index 4a6f4b5528a..565a6f0560a 100644 --- a/addons/point_of_sale/models/pos_order.py +++ b/addons/point_of_sale/models/pos_order.py @@ -1134,7 +1134,7 @@ class ReportSaleDetails(models.AbstractModel): products_sold[key] += line.qty if line.tax_ids_after_fiscal_position: - line_taxes = line.tax_ids_after_fiscal_position.compute_all(line.price_unit * (1-(line.discount or 0.0)/100.0), currency, line.qty, product=line.product_id, partner=line.order_id.partner_id or False) + line_taxes = line.tax_ids_after_fiscal_position.sudo().compute_all(line.price_unit * (1-(line.discount or 0.0)/100.0), currency, line.qty, product=line.product_id, partner=line.order_id.partner_id or False) for tax in line_taxes['taxes']: taxes.setdefault(tax['id'], {'name': tax['name'], 'tax_amount':0.0, 'base_amount':0.0}) taxes[tax['id']]['tax_amount'] += tax['amount']