[FIX] hr_expense: Bank account must not be impacted directly

The outstanding payment account must be used instead.

closes odoo/odoo#59066

Task: 2348361
X-original-commit: 84a9d31f8611d4890ce06c511fd74b13ce17958c
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
This commit is contained in:
Laurent Smet
2020-10-05 07:46:51 +00:00
parent d7a5ee11ed
commit ad77981a96
+3 -3
View File
@@ -387,9 +387,9 @@ Or send your receipts at <a href="mailto:%(email)s?subject=Lunch%%20with%%20cust
self.ensure_one()
account_dest = self.env['account.account']
if self.payment_mode == 'company_account':
if not self.sheet_id.bank_journal_id.default_account_id:
raise UserError(_("No account found for the %s journal, please configure one.") % (self.sheet_id.bank_journal_id.name))
account_dest = self.sheet_id.bank_journal_id.default_account_id.id
if not self.sheet_id.bank_journal_id.default_credit_account_id:
raise UserError(_("No credit account found for the %s journal, please configure one.") % (self.sheet_id.bank_journal_id.name))
account_dest = self.sheet_id.bank_journal_id.payment_credit_account_id.id
else:
if not self.employee_id.sudo().address_home_id:
raise UserError(_("No Home Address found for the employee %s, please configure one.") % (self.employee_id.name))