[FIX] web: form: remove o_field_invalid class when not necessary

Before this commit, the o_field_invalid class was not removed once an
invalid field becomes valid, until the user saves the form view (which
will rerender the full view anyway)
This commit is contained in:
Géry Debongnie
2017-05-22 10:07:33 +02:00
parent 3aad756d32
commit 8b94bf8b28
2 changed files with 3 additions and 1 deletions
@@ -84,6 +84,9 @@ var FormRenderer = BasicRenderer.extend({
_.each(resetWidgets, function (widget) {
self._setIDForLabel(widget, self.idsForLabels[widget.name]);
});
if (self.$('.o_field_invalid').length) {
self.canBeSaved(self.state.id);
}
return resetWidgets;
});
},
@@ -2273,7 +2273,6 @@ QUnit.module('Views', {
"input should be tagged as invalid");
form.$('input').val("tralala").trigger('input');
form.$buttons.find('.o_form_button_save').click();
assert.strictEqual(form.$('.o_field_invalid').length, 0,
"nothing should be marked as invalid");