summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2017-04-28 11:17:43 +0200
committerNicolas Martinelli <nim@odoo.com>2017-05-02 16:11:01 +0200
commitbe1ca7b100d60dccfbf9a540d13d5a9f62bdf609 (patch)
tree84656ac3a46df88455253c7e74d32f6c224fb85b /addons/web/static/src
parente645d38ce163e15876c51e5684d6ee6445aad263 (diff)
[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
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/framework/formats.js2
1 files changed, 1 insertions, 1 deletions
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':