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..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 @@ -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; @@ -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(); } } 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)]}" 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 @@ 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)]}" /> +