[FIX] Fixed float validation regex

bzr revid: fme@openerp.com-20110406095642-zzo7j178iqancfsk
This commit is contained in:
Fabien Meghazi 2011-04-06 11:56:42 +02:00
parent f600eceb31
commit c6115e1637
1 changed files with 1 additions and 1 deletions

View File

@ -466,7 +466,7 @@ openerp.base.form.FieldFloat = openerp.base.form.FieldChar.extend({
on_ui_change: function() {
this._super.apply(this, arguments);
this.value = this.$element.find('input').val().replace(/,/g, '.');
this.invalid = (this.required && this.value == "") || !this.value.match(/^\d(\.\d)?$/) ;
this.invalid = (this.required && this.value == "") || !this.value.match(/^\d+(\.\d+)?$/) ;
this.view.on_form_changed(this);
}
});