[FIX] web: is_false() for reference field widget. (#9335)

In the widget, the value of reference field is a pair `[val1, val2]`.
When the field is blank, its value is `[false,false]`, thus checking `[false,false] === false`
never succeeds, and this breaks the check for required fields.
This commit is contained in:
Devendra Kavthekar
2016-10-13 16:01:21 +02:00
committed by Raphael Collet
parent 5abe76c2d2
commit c63c225274
@@ -1152,6 +1152,9 @@ var FieldReference = common.AbstractField.extend(common.ReinitializeFieldMixin,
this.m2o.do_toggle(!!this.get('value')[0]);
this.reference_ready = true;
},
is_false: function() {
return this.get('value')[0] == false || this.get('value')[1] == false;
},
});
var FieldBinary = common.AbstractField.extend(common.ReinitializeFieldMixin, {