From 547a48f77bfa180bf55c04e63071a1463cff7dc0 Mon Sep 17 00:00:00 2001 From: Yolann Sabaux Date: Mon, 28 Aug 2023 10:59:37 +0200 Subject: [PATCH] [FIX] account: display the move to check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce: - Set "To Check" for a bill in the Bill list view - go back to the dashboard Issue: There won't be the "To Check" shortcut as it was the case in 15.0 opw-3455414 closes odoo/odoo#134432 X-original-commit: d8498091bc6e2cd441f5e4387e3833d1a2a1abc0 Signed-off-by: William André (wan) Signed-off-by: Yolann Sabaux (yosa) --- addons/account/models/account_journal_dashboard.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/account/models/account_journal_dashboard.py b/addons/account/models/account_journal_dashboard.py index f88528255d4..b87bc7fe396 100644 --- a/addons/account/models/account_journal_dashboard.py +++ b/addons/account/models/account_journal_dashboard.py @@ -449,7 +449,7 @@ class account_journal(models.Model): late_query_results = group_by_journal(self.env.cr.dictfetchall()) to_check_vals = { - vals['journal_id']: vals + vals['journal_id'][0]: vals for vals in self.env['account.move'].read_group( domain=[('journal_id', 'in', sale_purchase_journals.ids), ('to_check', '=', True)], fields=['amount_total_signed'], @@ -467,7 +467,7 @@ class account_journal(models.Model): (number_late, sum_late) = self._count_results_and_sum_amounts(late_query_results[journal.id], currency, curr_cache=curr_cache) to_check = to_check_vals.get(journal.id, {}) dashboard_data[journal.id].update({ - 'number_to_check': to_check.get('__count', 0), + 'number_to_check': to_check.get('journal_id_count', 0), 'to_check_balance': to_check.get('amount_total_signed', 0), 'title': _('Bills to pay') if journal.type == 'purchase' else _('Invoices owed to you'), 'number_draft': number_draft, @@ -486,7 +486,7 @@ class account_journal(models.Model): if not general_journals: return to_check_vals = { - vals['journal_id']: vals + vals['journal_id'][0]: vals for vals in self.env['account.move'].read_group( domain=[('journal_id', 'in', general_journals.ids), ('to_check', '=', True)], fields=['amount_total_signed'], @@ -495,7 +495,7 @@ class account_journal(models.Model): ) } for journal in general_journals: - vals = to_check_vals.get('journal_id', {}) + vals = to_check_vals.get(journal.id, {}) dashboard_data[journal.id].update({ 'number_to_check': vals.get('__count', 0), 'to_check_balance': vals.get('amount_total_signed', 0),