[FIX] account: fix traceback happened in accounting dashboard
For Odoo Fin purpose: When you click on Synchronize Now, you get a traceback. This traceback comes from the "_get_journal_bank_account_balance" method which performs a "self._cr.execute(...)" and a "self._cr.fetchone()". However, it is possible that the orm may invalidate the whole thing in the meantime because other calls are made. This fix corrects this by grouping the "execute" of the "fetchone". closes odoo/odoo#57555 X-original-commit: 7ab664bd8be72add3591895ef058afe7a1a9147e Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
This commit is contained in:
@@ -691,11 +691,11 @@ class AccountJournal(models.Model):
|
||||
FROM ''' + tables + '''
|
||||
WHERE ''' + where_clause + '''
|
||||
'''
|
||||
self._cr.execute(query, where_params)
|
||||
|
||||
company_currency = self.company_id.currency_id
|
||||
journal_currency = self.currency_id if self.currency_id and self.currency_id != company_currency else False
|
||||
|
||||
self._cr.execute(query, where_params)
|
||||
nb_lines, balance, amount_currency = self._cr.fetchone()
|
||||
return amount_currency if journal_currency else balance, nb_lines
|
||||
|
||||
|
||||
Reference in New Issue
Block a user