[FIX] account_reconcile_oca: Refresh view when adding information

pull/682/head
Enric Tobella 2024-08-13 23:17:42 +02:00
parent 3939e5b28c
commit 8d1c66d093
2 changed files with 7 additions and 6 deletions

View File

@ -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);
},
});

View File

@ -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();
}
}