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