Browse Source

[FIX] web_decimal_numpad: extend FieldMonetary (#867)

pull/877/head
David Vidal 7 years ago
committed by Pedro M. Baeza
parent
commit
5543939b13
  1. 4
      web_decimal_numpad_dot/__manifest__.py
  2. 11
      web_decimal_numpad_dot/static/src/js/numpad_dot.js

4
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": [

11
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,
};
});
Loading…
Cancel
Save