From 64f6e50d0ce6bfbb9474b416b08a55af2acbfa8a Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Tue, 7 Aug 2018 12:10:09 +0200 Subject: [PATCH] [FIX] web: Reset correctly the selection on reference fields Purpose ======= If the model on a reference fields is not modified from the interface by the user but by the server, the selection is not correctly recomputed on the interface. Specification ============= By calling super first on the '_reset' method, the new model is taken into account when resetting the selection. --- addons/web/static/src/js/fields/relational_fields.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index 5f10d1bf0cb..a016ed1aa03 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -2499,9 +2499,9 @@ var FieldReference = FieldMany2One.extend({ * @private */ _reset: function () { + this._super.apply(this, arguments); var value = this.$('select').val(); this._setState(); - this._super.apply(this, arguments); this.$('select').val(this.value && this.value.model || value); }, /**