Skip to content
Snippets Groups Projects
Commit 12410133 authored by Harsh Bhatt (habh)'s avatar Harsh Bhatt (habh)
Browse files

[FIX] account: fix traceback on opening bank statement


When user changes the default_account_id on a journal and tries to open a
statement line, they will get the traceback.

Note: This is reproduceable by using account_accountant only.

Steps to reproduce:
1) open configuration of bank journal
2) change default_account_id (bank account) from bank to cash
3) open bank statement
4) open any statement line
5) by following these steps, traceback occurs.

This commit will prevent the above traceback.

sentry - 4059226840

closes odoo/odoo#122428

Related: odoo/enterprise#42232
Signed-off-by: default avatarLaurent Smet <las@odoo.com>
parent 2d109b8b
Branches
Tags
No related merge requests found
......@@ -693,6 +693,9 @@ class AccountBankStatementLine(models.Model):
suspense_lines += line
else:
other_lines += line
if not liquidity_lines:
liquidity_lines = self.move_id.line_ids.filtered(lambda l: l.account_id.account_type == 'asset_cash')
other_lines -= liquidity_lines
return liquidity_lines, suspense_lines, other_lines
# SYNCHRONIZATION account.bank.statement.line <-> account.move
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment