[FIX] web: enforce length-limited char fields

In Odoo 10.0, `Char` fields with a maximum `size=` attribute were
indeed limited in the web client.
This commit is contained in:
Richard Mathot
2017-08-18 11:34:21 +02:00
parent 1ca79bd9f1
commit 0966f75b7e
@@ -341,6 +341,9 @@ var FieldChar = InputField.extend(TranslatableFieldMixin, {
*/
_renderEdit: function () {
var def = this._super.apply(this, arguments);
if (this.field.size && this.field.size > 0) {
this.$el.attr('maxlength', this.field.size);
}
this.$el = this.$el.add(this._renderTranslateButton());
return def;
},