diff --git a/addons/hr_expense/models/hr_expense.py b/addons/hr_expense/models/hr_expense.py index a08f85ea94f19194e00d31eb339040ce6713754a..52c91b2f7d15e6157ef40ce8d3e181b99c80a67b 100644 --- a/addons/hr_expense/models/hr_expense.py +++ b/addons/hr_expense/models/hr_expense.py @@ -531,7 +531,7 @@ Or send your receipts at <a href="mailto:%(email)s?subject=Lunch%%20with%%20cust move_line_name = expense.employee_id.name + ': ' + expense.name.split('\n')[0][:64] account_src = expense._get_expense_account_source() account_dst = expense._get_expense_account_destination() - account_date = expense.sheet_id.accounting_date or expense.date or fields.Date.context_today(expense) + account_date = expense.date or expense.sheet_id.accounting_date or fields.Date.context_today(expense) company_currency = expense.company_id.currency_id diff --git a/addons/hr_expense/tests/test_expenses.py b/addons/hr_expense/tests/test_expenses.py index 0a9d43bedb4f00508abb828a3c1c208a375e67c3..556e3dd0304e5d663fc985e0edff27575659ee3e 100644 --- a/addons/hr_expense/tests/test_expenses.py +++ b/addons/hr_expense/tests/test_expenses.py @@ -125,7 +125,7 @@ class TestExpenses(TestExpenseCommon): # Receivable line (foreign currency): { 'debit': 0.0, - 'credit': 750, + 'credit': 500.0, 'amount_currency': -1500.0, 'account_id': self.company_data['default_account_payable'].id, 'product_id': False, @@ -135,7 +135,7 @@ class TestExpenses(TestExpenseCommon): }, # Tax line (foreign currency): { - 'debit': 97.83, + 'debit': 65.22, 'credit': 0.0, 'amount_currency': 195.652, 'account_id': self.company_data['default_account_tax_purchase'].id, @@ -157,7 +157,7 @@ class TestExpenses(TestExpenseCommon): }, # Product line (foreign currency): { - 'debit': 652.17, + 'debit': 434.78, 'credit': 0.0, 'amount_currency': 1304.348, # untaxed amount 'account_id': self.company_data['default_account_expense'].id, @@ -188,7 +188,7 @@ class TestExpenses(TestExpenseCommon): 'currency_id': self.company_data['currency'].id, }, { - 'amount': -652.17, + 'amount': -434.78, 'date': fields.Date.from_string('2017-01-01'), 'account_id': self.analytic_account_2.id, 'currency_id': self.company_data['currency'].id,