From 7bc849c3a698665d6f2379aa2b8d870c14a6c849 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Wed, 12 Dec 2018 15:46:30 +0000 Subject: [PATCH] [FIX] account: journal dashboard shows invoices and refund for given journal Have an invoice and a credit not in one journal Go on the dashboard for journals Before this commit, the count of invoices in draft took into account both invoices and credit notes, while clicking on the button to see the invoices/credit notes only showed invoices After this commit, clicking on the button show both invoices and credit notes It is worth noting that this is the behavior in v11.0 And that the way the dashboard is computed cannot allow to differentiate within the kanban records, invoices and refunds as two separate buttons OPW 1916135 closes odoo/odoo#29482 --- addons/account/models/account_journal_dashboard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/models/account_journal_dashboard.py b/addons/account/models/account_journal_dashboard.py index 73da6d70183..f4753ef4796 100644 --- a/addons/account/models/account_journal_dashboard.py +++ b/addons/account/models/account_journal_dashboard.py @@ -320,10 +320,10 @@ class account_journal(models.Model): action_name = 'action_view_bank_statement_tree' elif self.type == 'sale': action_name = 'action_invoice_tree1' - self = self.with_context(use_domain=[('type', '=', 'out_invoice')]) + self = self.with_context(use_domain=[('type', 'in', ['out_invoice', 'out_refund'])]) elif self.type == 'purchase': action_name = 'action_vendor_bill_template' - self = self.with_context(use_domain=[('type', '=', 'in_invoice')]) + self = self.with_context(use_domain=[('type', 'in', ['in_invoice', 'in_refund'])]) else: action_name = 'action_move_journal_line'