[FIX] web: re-introduce on_change="0" to prevent onchanges for customization

In 10.0, adding on_change="0" allowed to prevent
default onchanges to occur for the field on which was added this attribute.

In 11.0, the rev. eaa66d1156
added a regression by removing this possibility.
It was an oversight, it was not an expected change
in the web client.

In 10.0, it's this line which bring this possibility:
https://github.com/odoo/odoo/commit/e8a00bc50da435d3859118ca127d20a2eb9a0cab#diff-ff0e90fb0eb4418a7f66e618e4b51323R444

opw-1883366

closes odoo/odoo#27952
This commit is contained in:
Denis Ledoux
2018-10-18 15:37:42 +00:00
parent 2c0a76fc7a
commit b7937ab6b7
@@ -273,7 +273,7 @@ return core.Class.extend({
attrs.options = attrs.options ? pyeval.py_eval(attrs.options) : {};
}
if (attrs.on_change && !field.onChange) {
if (attrs.on_change && attrs.on_change !== "0" && !field.onChange) {
field.onChange = "1";
}