forked from Techsystech/web
[FIX] web_decimal_numpad: extend FieldMonetary (#867)
parent
73bf9902df
commit
5a5cedce01
|
@ -3,12 +3,12 @@
|
||||||
# Copyright 2015 Tecnativa - Pedro M. Baeza
|
# Copyright 2015 Tecnativa - Pedro M. Baeza
|
||||||
# Copyright 2015 Comunitea - Omar Castiñeira Saavedra
|
# Copyright 2015 Comunitea - Omar Castiñeira Saavedra
|
||||||
# Copyright 2016 Oliver Dony
|
# 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).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": "Web - Numpad Dot as decimal separator",
|
"name": "Web - Numpad Dot as decimal separator",
|
||||||
"version": "11.0.1.0.0",
|
"version": "11.0.1.0.1",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"summary": "Allows using numpad dot to enter period decimal separator",
|
"summary": "Allows using numpad dot to enter period decimal separator",
|
||||||
"depends": [
|
"depends": [
|
||||||
|
|
|
@ -6,7 +6,7 @@ odoo.define("web_decimal_numpad_dot.FieldFloat", function (require) {
|
||||||
var basic_fields = require("web.basic_fields");
|
var basic_fields = require("web.basic_fields");
|
||||||
var translation = require("web.translation");
|
var translation = require("web.translation");
|
||||||
|
|
||||||
basic_fields.FieldFloat.include({
|
var NumpadDotReplaceMixin = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.events = $.extend({}, this.events, {
|
this.events = $.extend({}, this.events, {
|
||||||
"keydown": "numpad_dot_replace",
|
"keydown": "numpad_dot_replace",
|
||||||
|
@ -39,5 +39,12 @@ odoo.define("web_decimal_numpad_dot.FieldFloat", function (require) {
|
||||||
to = from + point.length
|
to = from + point.length
|
||||||
this.$input.prop("selectionStart", to).prop("selectionEnd", to);
|
this.$input.prop("selectionStart", to).prop("selectionEnd", to);
|
||||||
},
|
},
|
||||||
});
|
};
|
||||||
|
|
||||||
|
basic_fields.FieldFloat.include(NumpadDotReplaceMixin);
|
||||||
|
basic_fields.FieldMonetary.include(NumpadDotReplaceMixin);
|
||||||
|
|
||||||
|
return {
|
||||||
|
NumpadDotReplaceMixin: NumpadDotReplaceMixin,
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue