From 2d5b4ca4b2198b42dbaf46d8489f3dd5e1c01780 Mon Sep 17 00:00:00 2001 From: "Julien CHEVREAU (JCU)" Date: Wed, 5 May 2021 12:51:15 +0000 Subject: [PATCH] [IMP] account: Improve Journal Entries view From Bank Statements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Beforehand, when display the journal entries from a bank statement, some fields (Due Date, Next Activity, Payment status) that are not very relevant were displayed. Now, we use the bank & cash view to display the bank statement in a more relevant manner. closes odoo/odoo#70811 Task: 2459562 Signed-off-by: William André (wan) --- addons/account/models/account_bank_statement.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index ef4d0376716..ee468b0eb4f 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -462,13 +462,16 @@ class AccountBankStatement(models.Model): def button_journal_entries(self): return { 'name': _('Journal Entries'), - 'view_mode': 'tree,form', - 'res_model': 'account.move', - 'view_id': False, + 'view_mode': 'tree', + 'res_model': 'account.move.line', + 'view_id': self.env.ref('account.view_move_line_tree_grouped_bank_cash').id, 'type': 'ir.actions.act_window', - 'domain': [('id', 'in', self.line_ids.move_id.ids)], + 'domain': [('move_id', 'in', self.line_ids.move_id.ids)], 'context': { + 'search_default_account_id': self.journal_id.default_account_id.id, 'journal_id': self.journal_id.id, + 'group_by': 'move_id', + 'expand': True } }