[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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user