diff --git a/web_decimal_numpad_dot/__manifest__.py b/web_decimal_numpad_dot/__manifest__.py index 857b38bb..4864b9fa 100644 --- a/web_decimal_numpad_dot/__manifest__.py +++ b/web_decimal_numpad_dot/__manifest__.py @@ -3,12 +3,12 @@ # Copyright 2015 Tecnativa - Pedro M. Baeza # Copyright 2015 Comunitea - Omar CastiƱeira Saavedra # Copyright 2016 Oliver Dony -# Copyright 2017 Tecnativa - David Vidal +# Copyright 2017-18 Tecnativa - David Vidal # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Web - Numpad Dot as decimal separator", - "version": "11.0.1.0.0", + "version": "11.0.1.0.1", "license": "AGPL-3", "summary": "Allows using numpad dot to enter period decimal separator", "depends": [ diff --git a/web_decimal_numpad_dot/static/src/js/numpad_dot.js b/web_decimal_numpad_dot/static/src/js/numpad_dot.js index a9860de5..78b47a24 100644 --- a/web_decimal_numpad_dot/static/src/js/numpad_dot.js +++ b/web_decimal_numpad_dot/static/src/js/numpad_dot.js @@ -6,7 +6,7 @@ odoo.define("web_decimal_numpad_dot.FieldFloat", function (require) { var basic_fields = require("web.basic_fields"); var translation = require("web.translation"); - basic_fields.FieldFloat.include({ + var NumpadDotReplaceMixin = { init: function () { this.events = $.extend({}, this.events, { "keydown": "numpad_dot_replace", @@ -39,5 +39,12 @@ odoo.define("web_decimal_numpad_dot.FieldFloat", function (require) { to = from + point.length this.$input.prop("selectionStart", to).prop("selectionEnd", to); }, - }); + }; + + basic_fields.FieldFloat.include(NumpadDotReplaceMixin); + basic_fields.FieldMonetary.include(NumpadDotReplaceMixin); + + return { + NumpadDotReplaceMixin: NumpadDotReplaceMixin, + }; });