From a63e26e6fdf6a312fe5770a8ea604470806bb333 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 9 Aug 2022 23:08:28 +0200 Subject: [PATCH] [FIX] account_reconcilication_widget: notifications Notifications displayed at the start of the reconciliation interface are back up and running (it was working in v10, broken in v12 and v13). For example, when you import an OFX file and go directly to the reconciliation interface, it will display the number of transactions that were automatically dropped because they were already present in Odoo (detected via the unique_import_id). --- .../static/src/js/reconciliation/reconciliation_action.js | 2 ++ .../static/src/js/reconciliation/reconciliation_renderer.js | 3 +++ 2 files changed, 5 insertions(+) diff --git a/account_reconciliation_widget/static/src/js/reconciliation/reconciliation_action.js b/account_reconciliation_widget/static/src/js/reconciliation/reconciliation_action.js index e0bae4b9..b057cd86 100644 --- a/account_reconciliation_widget/static/src/js/reconciliation/reconciliation_action.js +++ b/account_reconciliation_widget/static/src/js/reconciliation/reconciliation_action.js @@ -87,6 +87,7 @@ odoo.define("account.ReconciliationClientAction", function (require) { this._super.apply(this, arguments); this.action_manager = parent; this.params = params; + this.notifications = params.context.notifications || []; this.searchModelConfig.modelName = "account.bank.statement.line"; this.controlPanelProps.cp_content = {}; this.model = new this.config.Model(this, { @@ -158,6 +159,7 @@ odoo.define("account.ReconciliationClientAction", function (require) { valuemax: self.model.valuemax, defaultDisplayQty: self.model.defaultDisplayQty, title: title, + notifications: self.notifications, }); }); }); diff --git a/account_reconciliation_widget/static/src/js/reconciliation/reconciliation_renderer.js b/account_reconciliation_widget/static/src/js/reconciliation/reconciliation_renderer.js index 0415a040..26146f76 100644 --- a/account_reconciliation_widget/static/src/js/reconciliation/reconciliation_renderer.js +++ b/account_reconciliation_widget/static/src/js/reconciliation/reconciliation_renderer.js @@ -38,6 +38,9 @@ odoo.define("account.ReconciliationRenderer", function (require) { var defs = [this._super.apply(this, arguments)]; this.time = Date.now(); this.$progress = $(""); + if (this._initialState.notifications.length > 0) { + this._renderNotifications(this._initialState.notifications); + } return Promise.all(defs); },