From 2082a749072a6ac5cb451f968b482ecee1946ce6 Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Tue, 13 Aug 2024 22:58:16 +0200 Subject: [PATCH 1/4] [IMP] account_reconcile_oca: improve search filters --- account_reconcile_oca/views/account_move_line.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_reconcile_oca/views/account_move_line.xml b/account_reconcile_oca/views/account_move_line.xml index f993c355..e1cb2901 100644 --- a/account_reconcile_oca/views/account_move_line.xml +++ b/account_reconcile_oca/views/account_move_line.xml @@ -40,7 +40,7 @@ From fd92ead749ccf3e38d921b109e4e921f851a42dd Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Tue, 13 Aug 2024 22:58:35 +0200 Subject: [PATCH 2/4] [IMP] account_statement_base: Add extra fields --- account_statement_base/views/account_bank_statement_line.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/account_statement_base/views/account_bank_statement_line.xml b/account_statement_base/views/account_bank_statement_line.xml index a4bf9f04..812454c8 100644 --- a/account_statement_base/views/account_bank_statement_line.xml +++ b/account_statement_base/views/account_bank_statement_line.xml @@ -72,6 +72,8 @@ optional="hide" attrs="{'readonly': [('is_reconciled', '=', True)]}" /> + + @@ -89,6 +91,7 @@ groups="base.group_multi_currency" attrs="{'readonly': [('is_reconciled', '=', True)]}" /> + Date: Tue, 13 Aug 2024 23:12:42 +0200 Subject: [PATCH 3/4] [FIX] account_reconcile_oca: Remove bug when accessing from move view --- .../static/src/js/reconcile/reconcile_controller.esm.js | 2 +- account_reconcile_oca/views/account_move.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/account_reconcile_oca/static/src/js/reconcile/reconcile_controller.esm.js b/account_reconcile_oca/static/src/js/reconcile/reconcile_controller.esm.js index 9c83aa86..89e9c5cf 100644 --- a/account_reconcile_oca/static/src/js/reconcile/reconcile_controller.esm.js +++ b/account_reconcile_oca/static/src/js/reconcile/reconcile_controller.esm.js @@ -31,7 +31,7 @@ export class ReconcileController extends KanbanController { }); } get journalId() { - if (this.props.resModel === "account.bank.statement.line") { + if (this.props.context.active_model === "account.journal") { return this.props.context.active_id; } return false; diff --git a/account_reconcile_oca/views/account_move.xml b/account_reconcile_oca/views/account_move.xml index c966b79d..d781c971 100644 --- a/account_reconcile_oca/views/account_move.xml +++ b/account_reconcile_oca/views/account_move.xml @@ -13,6 +13,7 @@ type="action" name="%(account_reconcile_oca.action_bank_statement_line_move_view_reconcile)s" string="Bank reconcile" + context="{'search_default_move_id': id}" class="btn btn-primary" icon="fa-list" attrs="{'invisible': [('statement_line_id', '=', False)]}" From 8d1c66d09331afe3fae9f1538be4726e10b5bcdb Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Tue, 13 Aug 2024 23:17:42 +0200 Subject: [PATCH 4/4] [FIX] account_reconcile_oca: Refresh view when adding information --- .../src/js/reconcile/reconcile_controller.esm.js | 1 + .../reconcile_form/reconcile_form_controller.esm.js | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/account_reconcile_oca/static/src/js/reconcile/reconcile_controller.esm.js b/account_reconcile_oca/static/src/js/reconcile/reconcile_controller.esm.js index 89e9c5cf..8d4777ff 100644 --- a/account_reconcile_oca/static/src/js/reconcile/reconcile_controller.esm.js +++ b/account_reconcile_oca/static/src/js/reconcile/reconcile_controller.esm.js @@ -67,6 +67,7 @@ export class ReconcileController extends KanbanController { this.action.doAction(action, { onClose: async () => { await this.model.root.load(); + await this.updateJournalInfo(); this.render(true); }, }); diff --git a/account_reconcile_oca/static/src/js/reconcile_form/reconcile_form_controller.esm.js b/account_reconcile_oca/static/src/js/reconcile_form/reconcile_form_controller.esm.js index d91b4bda..ae5640dd 100644 --- a/account_reconcile_oca/static/src/js/reconcile_form/reconcile_form_controller.esm.js +++ b/account_reconcile_oca/static/src/js/reconcile_form/reconcile_form_controller.esm.js @@ -23,10 +23,12 @@ export class ReconcileFormController extends FormController { async reloadFormController() { var is_reconciled = this.model.root.data.is_reconciled; await this.model.root.load(); - if (!is_reconciled && this.model.root.data.is_reconciled) { - // This only happens when we press the reconcile button - if (this.env.parentController) { - // Showing rainbow man + if (this.env.parentController) { + // We will update the parent controller every time we reload the form. + await this.env.parentController.model.root.load(); + await this.env.parentController.render(true); + if (!is_reconciled && this.model.root.data.is_reconciled) { + // This only happens when we press the reconcile button for showing rainbow man const message = await this.orm.call( "account.journal", "get_rainbowman_message", @@ -36,8 +38,6 @@ export class ReconcileFormController extends FormController { this.env.parentController.setRainbowMan(message); } // Refreshing - await this.env.parentController.model.root.load(); - await this.env.parentController.render(true); this.env.parentController.selectRecord(); } }