[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) <len@odoo.com>
This commit is contained in:
Nans Lefebvre
2019-04-25 13:45:47 +00:00
parent 61f82c077d
commit b7f4ff4b54
+1 -1
View File
@@ -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