From 03645bc51fc9c8aae8dbb227110847da306c5a52 Mon Sep 17 00:00:00 2001 From: Hiral Bhavsar Date: Tue, 20 Feb 2018 19:28:34 +0530 Subject: [PATCH] [FIX] account: filters on invoices and bills - Removed 'Invoices' and 'Credit Notes' filters. - Removed inherited view of filters to remove the 'Not Draft' filter. - Renamed 'Not Paid' to 'Open' filter. - Added new filter 'Paid'. - When click on 'Invoices/Bills' or 'Credit Notes' link of 'View' column from 'Customer Invoices' and 'Vendor Bills' dashboard, it should be open invoices with a specific domain instead of default filters. Co-authored-by: Nicolas Martinelli opw-1817236 --- .../models/account_journal_dashboard.py | 3 +- addons/account/views/account_invoice_view.xml | 30 +++++++------------ .../views/account_journal_dashboard_view.xml | 12 +++----- 3 files changed, 16 insertions(+), 29 deletions(-) diff --git a/addons/account/models/account_journal_dashboard.py b/addons/account/models/account_journal_dashboard.py index 26cb462b356..9ed3f9f65d2 100644 --- a/addons/account/models/account_journal_dashboard.py +++ b/addons/account/models/account_journal_dashboard.py @@ -346,12 +346,13 @@ class account_journal(models.Model): ctx.update({ 'journal_type': self.type, 'default_journal_id': self.id, - 'search_default_journal_id': self.id, 'default_type': invoice_type, 'type': invoice_type }) [action] = self.env.ref('account.%s' % action_name).read() + if not self.env.context.get('use_domain'): + ctx['search_default_journal_id'] = self.id action['context'] = ctx action['domain'] = self._context.get('use_domain', []) account_invoice_filter = self.env.ref('account.view_account_invoice_filter', False) diff --git a/addons/account/views/account_invoice_view.xml b/addons/account/views/account_invoice_view.xml index 97f56d66a11..e27615b8fea 100644 --- a/addons/account/views/account_invoice_view.xml +++ b/addons/account/views/account_invoice_view.xml @@ -528,10 +528,8 @@ - - - - + + @@ -563,33 +561,25 @@ + account.invoice.select.invoices account.invoice primary - - - Not Draft - - - + + account.invoice.select.credit.notes account.invoice primary - - - Not Draft - - - + @@ -660,7 +650,7 @@ [('type','=','out_invoice')] {'type':'out_invoice', 'journal_type': 'sale'} - +

Click to create a customer invoice. @@ -701,7 +691,7 @@ [('type','=','out_refund')] {'default_type': 'out_refund', 'type': 'out_refund', 'journal_type': 'sale'} - +

Click to create a credit note. @@ -739,7 +729,7 @@ [('type','=','in_invoice')] {'default_type': 'in_invoice', 'type': 'in_invoice', 'journal_type': 'purchase'} - +

Click to record a new vendor bill. @@ -775,7 +765,7 @@ [('type','=','in_refund')] {'default_type': 'in_refund', 'type': 'in_refund', 'journal_type': 'purchase'} - +

Click to record a new vendor credit note. diff --git a/addons/account/views/account_journal_dashboard_view.xml b/addons/account/views/account_journal_dashboard_view.xml index 0c910e12251..5db552205ef 100644 --- a/addons/account/views/account_journal_dashboard_view.xml +++ b/addons/account/views/account_journal_dashboard_view.xml @@ -117,16 +117,12 @@ View