[FIX] hr_expense: remove traceback when post entry

The `state` field of `account.payment` no longer exists and should not be set explicitely.
Set the `ref` field to the expense name instead of the `name`field.

Task ID 2266922

closes odoo/odoo#52823

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
This commit is contained in:
Simon Genin (ges)
2020-06-12 13:21:13 +00:00
parent 394e9fa4aa
commit 84cc6fab9e
+1 -2
View File
@@ -514,10 +514,9 @@ class HrExpense(models.Model):
'partner_type': 'supplier',
'journal_id': journal.id,
'date': expense.date,
'state': 'reconciled',
'currency_id': expense.currency_id.id if different_currency else journal_currency.id,
'amount': abs(total_amount_currency) if different_currency else abs(total_amount),
'name': expense.name,
'ref': expense.name,
})
move_line_dst['payment_id'] = payment.id