From 8000e895cd33cb622919fe6f48934cb692728bc2 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Fri, 8 May 2020 12:17:26 +0000 Subject: [FIX] web: failing quick create in m2o inside x2m Write something in a many2one field, and click on 'Create "..."' to quick create a record with the given value (name_create). When the name_create fails (e.g. because there are mandatory fields in the model), we open a form view. Before this commit, when this happened for many2one fields inside x2many editable lists, it crashed, since [1]. [1] 50bf8309f88fb6c8d8e27b14d40450e92e5a4e4e closes odoo/odoo#50948 X-original-commit: 43c513306094444ff25ad98584b426ddb8a3b525 Signed-off-by: Julien Mougenot (jum) Signed-off-by: Aaron Bohy (aab) --- addons/web/static/src/js/fields/relational_fields.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src/js/fields') diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index 50aeb461ee5..83bc4c8a7f0 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -1548,9 +1548,9 @@ var FieldX2Many = AbstractField.extend(WidgetAdapterMixin, { if (ev.data.onSuccess) { ev.data.onSuccess(); } - }).guardedCatch(function () { + }).guardedCatch(function (reason) { if (ev.data.onFailure) { - ev.data.onFailure(); + ev.data.onFailure(reason); } }); } -- cgit v1.2.3