From a249c99e0c442d567295fccf73eccd2fd30aaec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=A9o=20Goddet?= Date: Sat, 30 Oct 2021 16:34:41 +0200 Subject: [PATCH] [FIX] account_reconcile_widget: analytic tags formatting before this commit. analytic tags are not correctly formatted when sent to the server after reconciliation, that lead to an error being raised. Steps to reproduce the problem: - Create a reconciliation model of type "Manually create a write-off on clicked button". - Show analytic on the configuration and show the optional column "Analytic tags". - Put any analytic tag. When using such reconciliation model on the reconciliation, the analytic tag is not well formatted and you can't complete the reconciliation. --- .../static/src/js/reconciliation/reconciliation_model.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/account_reconciliation_widget/static/src/js/reconciliation/reconciliation_model.js b/account_reconciliation_widget/static/src/js/reconciliation/reconciliation_model.js index 7c962d1e..75f67935 100644 --- a/account_reconciliation_widget/static/src/js/reconciliation/reconciliation_model.js +++ b/account_reconciliation_widget/static/src/js/reconciliation/reconciliation_model.js @@ -1351,7 +1351,12 @@ odoo.define("account.ReconciliationModel", function (require) { _formatMany2ManyTags: function (value) { var res = []; for (var i = 0, len = value.length; i < len; i++) { - res[i] = {id: value[i][0], display_name: value[i][1]}; + res.push({ + id: value[i], + display_name: this.analyticTags[value[i]] + ? this.analyticTags[value[i]].display_name + : "", + }); } return res; },