From fedb7b74905dc723917ce6c76bc2d2c0b883742a Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Tue, 13 Aug 2024 23:17:42 +0200 Subject: [PATCH] [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 fd9f7cb9..55697e35 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 @@ -69,6 +69,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(); } }