[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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user