account_usability_akretion: change behavior of running balance in dashboard

Use accounting balance like in v14 and not bank statement start/end balance
This commit is contained in:
Alexis de Lattre
2025-02-19 10:43:02 +00:00
parent 0aa31956e0
commit 66f617e797
2 changed files with 12 additions and 4 deletions

View File

@@ -9,7 +9,7 @@ class AccountJournal(models.Model):
_inherit = 'account.journal'
hide_bank_statement_balance = fields.Boolean(
string='Hide and Disable Bank Statement Balance',
string='Hide and Disable Bank Statement Balance', default=True,
help="When this option is enabled, the start and end balance is "
"not displayed on the bank statement form view, and the check of "
"the end balance vs the real end balance is disabled. When you enable "
@@ -55,3 +55,12 @@ class AccountJournal(models.Model):
'search_default_posted': True,
}
return action
# field used in journal dashboard for bank journals
# compute account_balance like in v14, using accounting and
# NOT bank statement balance_start/balance_end
def _compute_current_statement_balance(self):
query_result = self._get_journal_dashboard_bank_running_balance()
for journal in self:
journal.has_statement_lines = query_result.get(journal.id)[0]
journal.current_statement_balance = journal._get_journal_bank_account_balance()[0]