From be1ca7b100d60dccfbf9a540d13d5a9f62bdf609 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 28 Apr 2017 11:17:43 +0200 Subject: [PATCH] [FIX] web: min/max integer In PostgreSQL, a field of type `integer` must be in the range -2147483648 to +2147483647. If the user enters a lower or a larger value, a traceback is thrown. opw-740286 --- addons/web/static/src/js/framework/formats.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/framework/formats.js b/addons/web/static/src/js/framework/formats.js index 479fa1082cd..c4d001a12e1 100644 --- a/addons/web/static/src/js/framework/formats.js +++ b/addons/web/static/src/js/framework/formats.js @@ -130,7 +130,7 @@ function parse_value (value, descriptor, value_if_empty) { } while(tmp !== value); tmp = Number(value); // do not accept not numbers or float values - if (isNaN(tmp) || tmp % 1) + if (isNaN(tmp) || tmp % 1 || tmp < -2147483648 || tmp > 2147483647) throw new Error(_.str.sprintf(_t("'%s' is not a correct integer"), value)); return tmp; case 'monetary':