[FIX] Fixed float validation regex
authorFabien Meghazi <fme@openerp.com>
Wed, 6 Apr 2011 09:56:42 +0000 (11:56 +0200)
committerFabien Meghazi <fme@openerp.com>
Wed, 6 Apr 2011 09:56:42 +0000 (11:56 +0200)
bzr revid: fme@openerp.com-20110406095642-zzo7j178iqancfsk

addons/base/static/src/js/form.js

index 85cf0bc..4067ccc 100644 (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);
     }
 });