[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:
@@ -341,6 +341,9 @@ var FieldChar = InputField.extend(TranslatableFieldMixin, {
|
|||||||
*/
|
*/
|
||||||
_renderEdit: function () {
|
_renderEdit: function () {
|
||||||
var def = this._super.apply(this, arguments);
|
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());
|
this.$el = this.$el.add(this._renderTranslateButton());
|
||||||
return def;
|
return def;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user