From 82803328b2efca90f607b453a446621a96bfe8c2 Mon Sep 17 00:00:00 2001 From: Kevin Baptiste Date: Tue, 30 Nov 2021 14:57:59 +0000 Subject: [PATCH] [FIX] hr_expense: allow users to read paid expenses Simple users lost the ability to read their own paid expenses due to missing access rights on account.move. closes odoo/odoo#80646 Taskid: 2698791 X-original-commit: f164967c1eef731e92f41945b9a9fa05099950d9 Signed-off-by: Kevin Baptiste --- addons/hr_expense/models/hr_expense.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_expense/models/hr_expense.py b/addons/hr_expense/models/hr_expense.py index 591bb030955..1338b44804c 100644 --- a/addons/hr_expense/models/hr_expense.py +++ b/addons/hr_expense/models/hr_expense.py @@ -163,7 +163,7 @@ class HrExpense(models.Model): residual_field = 'amount_residual' else: residual_field = 'amount_residual_currency' - payment_term_lines = expense.sheet_id.account_move_id.line_ids \ + payment_term_lines = expense.sheet_id.account_move_id.sudo().line_ids \ .filtered(lambda line: line.expense_id == self and line.account_internal_type in ('receivable', 'payable')) expense.amount_residual = -sum(payment_term_lines.mapped(residual_field))