parse_value: interger != float

Wwhen parsing a integer field, do not accept float values. '1' or '1.0' is ok but not '1.1'. (opw 608544)
This commit is contained in:
Martin Trigaux 2014-06-12 12:24:48 +02:00
parent 4d3a5df001
commit 0b4921e4d6
1 changed files with 2 additions and 1 deletions

View File

@ -228,7 +228,8 @@ instance.web.parse_value = function (value, descriptor, value_if_empty) {
value = value.replace(instance.web._t.database.parameters.thousands_sep, "");
} while(tmp !== value);
tmp = Number(value);
if (isNaN(tmp))
// do not accept not numbers or float values
if (isNaN(tmp) || tmp % 1)
throw new Error(_.str.sprintf(_t("'%s' is not a correct integer"), value));
return tmp;
case 'float':