[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.
This commit is contained in:
Yannick Tivisse
2018-08-08 17:35:34 +02:00
parent 91b62235f8
commit 64f6e50d0c
@@ -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);
},
/**