From b7f4ff4b540042b57454d2f2ef199141ed59ada6 Mon Sep 17 00:00:00 2001 From: Nans Lefebvre Date: Thu, 25 Apr 2019 12:42:59 +0000 Subject: [PATCH] [FIX] hr_expense: fix payment entry of expenses paid by company Create an expense paid directly by the company, validate and post entries. While the account move lines are correct, the payment is not: it is always null. opw 1962500 closes odoo/odoo#32956 Signed-off-by: Nans Lefebvre (len) --- 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 398bba34cad..30aeb114f5f 100644 --- a/addons/hr_expense/models/hr_expense.py +++ b/addons/hr_expense/models/hr_expense.py @@ -365,7 +365,7 @@ class HrExpense(models.Model): # get move line values move_line_values = move_line_values_by_expense.get(expense.id) move_line_dst = move_line_values[-1] - total_amount = abs(move_line_dst['debit']) + total_amount = move_line_dst['debit'] or -move_line_dst['credit'] total_amount_currency = move_line_dst['amount_currency'] # create one more move line, a counterline for the total on payable account