diff --git a/web_decimal_numpad_dot/README.rst b/web_decimal_numpad_dot/README.rst new file mode 100644 index 000000000000..82e353e2d422 --- /dev/null +++ b/web_decimal_numpad_dot/README.rst @@ -0,0 +1,92 @@ +===================================== +Web - Numpad Dot as decimal separator +===================================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github + :target: https://github.com/OCA/web/tree/12.0/web_decimal_numpad_dot + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_decimal_numpad_dot + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/162/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Allows using numpad dot to enter period decimal separator even in localizations +where comma is used instead of period. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Whenever on a float or monetary input field pressing numpad dot produces the +proper decimal separator for the active localization. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* AvanzOSC +* Comunitea +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* Oihane Crucelaegui +* Ana Juaristi +* Omar Castiñeira Saavedra +* Oliver Dony <@odony> +* Wim Audenaert +* `Tecnativa `_: + + * Pedro M. Baeza + * David Vidal + * Jairo Llopis + * Ernesto Tejeda + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/web `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_decimal_numpad_dot/__init__.py b/web_decimal_numpad_dot/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/web_decimal_numpad_dot/__manifest__.py b/web_decimal_numpad_dot/__manifest__.py new file mode 100644 index 000000000000..c9029b5f072b --- /dev/null +++ b/web_decimal_numpad_dot/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright 2015 AvanzOSC - Oihane Crucelaegui +# Copyright 2015 Tecnativa - Pedro M. Baeza +# Copyright 2015 Comunitea - Omar Castiñeira Saavedra +# Copyright 2016 Oliver Dony +# 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": "13.0.1.0.0", + "license": "AGPL-3", + "summary": "Allows using numpad dot to enter period decimal separator", + "depends": ["web"], + "author": "AvanzOSC, " + "Comunitea, " + "Tecnativa, " + "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/web", + "category": "Web", + "data": ["views/web_decimal_numpad_dot.xml"], + "installable": True, +} diff --git a/web_decimal_numpad_dot/i18n/web_decimal_numpad_dot.pot b/web_decimal_numpad_dot/i18n/web_decimal_numpad_dot.pot new file mode 100644 index 000000000000..d2e396f159e1 --- /dev/null +++ b/web_decimal_numpad_dot/i18n/web_decimal_numpad_dot.pot @@ -0,0 +1,14 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + diff --git a/web_decimal_numpad_dot/i18n/zh_CN.po b/web_decimal_numpad_dot/i18n/zh_CN.po new file mode 100644 index 000000000000..4159be77e050 --- /dev/null +++ b/web_decimal_numpad_dot/i18n/zh_CN.po @@ -0,0 +1,14 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" diff --git a/web_decimal_numpad_dot/readme/CONTRIBUTORS.rst b/web_decimal_numpad_dot/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..7112a86df69c --- /dev/null +++ b/web_decimal_numpad_dot/readme/CONTRIBUTORS.rst @@ -0,0 +1,15 @@ +* Oihane Crucelaegui +* Ana Juaristi +* Omar Castiñeira Saavedra +* Oliver Dony <@odony> +* Wim Audenaert +* `Tecnativa `_: + + * Pedro M. Baeza + * David Vidal + * Jairo Llopis + * Ernesto Tejeda + +* `C2i Change 2 improve `_: + + * Eduardo Magdalena diff --git a/web_decimal_numpad_dot/readme/DESCRIPTION.rst b/web_decimal_numpad_dot/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..9737bec1652f --- /dev/null +++ b/web_decimal_numpad_dot/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +Allows using numpad dot to enter period decimal separator even in localizations +where comma is used instead of period. diff --git a/web_decimal_numpad_dot/readme/USAGE.rst b/web_decimal_numpad_dot/readme/USAGE.rst new file mode 100644 index 000000000000..b7eab3807b0d --- /dev/null +++ b/web_decimal_numpad_dot/readme/USAGE.rst @@ -0,0 +1,2 @@ +Whenever on a float or monetary input field pressing numpad dot produces the +proper decimal separator for the active localization. diff --git a/web_decimal_numpad_dot/static/description/icon.png b/web_decimal_numpad_dot/static/description/icon.png new file mode 100644 index 000000000000..9c205cbc407e Binary files /dev/null and b/web_decimal_numpad_dot/static/description/icon.png differ diff --git a/web_decimal_numpad_dot/static/description/index.html b/web_decimal_numpad_dot/static/description/index.html new file mode 100644 index 000000000000..bbadf8a38874 --- /dev/null +++ b/web_decimal_numpad_dot/static/description/index.html @@ -0,0 +1,439 @@ + + + + + + +Web - Numpad Dot as decimal separator + + + +
+

Web - Numpad Dot as decimal separator

+ + +

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runbot

+

Allows using numpad dot to enter period decimal separator even in localizations +where comma is used instead of period.

+

Table of contents

+ +
+

Usage

+

Whenever on a float or monetary input field pressing numpad dot produces the +proper decimal separator for the active localization.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • AvanzOSC
  • +
  • Comunitea
  • +
  • Tecnativa
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/web project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/web_decimal_numpad_dot/static/src/js/numpad_dot.js b/web_decimal_numpad_dot/static/src/js/numpad_dot.js new file mode 100644 index 000000000000..9516dd67c80b --- /dev/null +++ b/web_decimal_numpad_dot/static/src/js/numpad_dot.js @@ -0,0 +1,44 @@ +/* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ + +odoo.define("web_decimal_numpad_dot.FieldFloat", function (require) { + "use strict"; + + var basic_fields = require("web.basic_fields"); + var translation = require("web.translation"); + + var NumpadDotReplaceMixin = { + l10n_decimal_point: function () { + return this.formatType === "float_time" + ? ":" : translation._t.database.parameters.decimal_point; + }, + + _replaceAt: function (cur_val, from, to, replacement) { + return cur_val.substring(0, from) + replacement + + cur_val.substring(to); + }, + + _onKeydown: function (event) { + // Only act on numpad dot key + if (event.keyCode !== 110) { + return this._super.apply(this, arguments); + } + event.preventDefault(); + var from = this.$input.prop("selectionStart"), + to = this.$input.prop("selectionEnd"), + cur_val = this.$input.val(), + point = this.l10n_decimal_point(); + var new_val = this._replaceAt(cur_val, from, to, point); + this.$input.val(new_val); + // Put user caret in place + 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, + }; +}); diff --git a/web_decimal_numpad_dot/views/web_decimal_numpad_dot.xml b/web_decimal_numpad_dot/views/web_decimal_numpad_dot.xml new file mode 100644 index 000000000000..d4815753b0c9 --- /dev/null +++ b/web_decimal_numpad_dot/views/web_decimal_numpad_dot.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/web_dialog_size/static/src/js/web_dialog_size.js b/web_dialog_size/static/src/js/web_dialog_size.js index 63b6af62bc20..e13aa88eaa06 100644 --- a/web_dialog_size/static/src/js/web_dialog_size.js +++ b/web_dialog_size/static/src/js/web_dialog_size.js @@ -1,66 +1,70 @@ odoo.define('web_dialog_size.web_dialog_size', function (require) { -'use strict'; + 'use strict'; -var rpc = require('web.rpc'); -var Dialog = require('web.Dialog'); + var rpc = require('web.rpc'); + var Dialog = require('web.Dialog'); -var config = rpc.query({ - model: 'ir.config_parameter', - method: 'get_web_dialog_size_config', -}); + var config = rpc.query({ + model: 'ir.config_parameter', + method: 'get_web_dialog_size_config', + }); -Dialog.include({ + Dialog.include({ - willStart: function () { - var self = this; - return this._super.apply(this, arguments).then(function () { - self.$modal.find('.dialog_button_extend').on('click', self.proxy('_extending')); - self.$modal.find('.dialog_button_restore').on('click', self.proxy('_restore')); - return config.then(function(r) { - if (r.default_maximize) { - self._extending(); - } else { - self._restore(); - } + willStart: function () { + var self = this; + return this._super.apply(this, arguments).then(function () { + self.$modal.find('.dialog_button_extend').on('click', + self.proxy('_extending') + ); + self.$modal.find('.dialog_button_restore').on('click', + self.proxy('_restore') + ); + return config.then(function (r) { + if (r.default_maximize) { + self._extending(); + } else { + self._restore(); + } + }); }); - }); - }, + }, - opened: function(handler) { - return this._super.apply(this, arguments).then(function(){ - if (this.$modal) { - this.$modal.draggable({ - handle: '.modal-header', - helper: false - }); - } - }.bind(this)); - }, + opened: function () { + return this._super.apply(this, arguments).then(function () { + if (this.$modal) { + this.$modal.draggable({ + handle: '.modal-header', + helper: false, + }); + } + }.bind(this)); + }, - close: function() { - if (this.$modal) { - var draggable = this.$modal.draggable("instance"); - if (draggable) { - this.$modal.draggable("destroy"); + close: function () { + if (this.$modal) { + var draggable = this.$modal.draggable("instance"); + if (draggable) { + this.$modal.draggable("destroy"); + } } - } - return this._super.apply(this, arguments); - }, + return this._super.apply(this, arguments); + }, - _extending: function() { - var dialog = this.$modal.find('.modal-dialog'); - dialog.addClass('dialog_full_screen'); - dialog.find('.dialog_button_extend').hide(); - dialog.find('.dialog_button_restore').show(); - }, + _extending: function () { + var dialog = this.$modal.find('.modal-dialog'); + dialog.addClass('dialog_full_screen'); + dialog.find('.dialog_button_extend').hide(); + dialog.find('.dialog_button_restore').show(); + }, - _restore: function() { - var dialog = this.$modal.find('.modal-dialog'); - dialog.removeClass('dialog_full_screen'); - dialog.find('.dialog_button_restore').hide(); - dialog.find('.dialog_button_extend').show(); - }, + _restore: function () { + var dialog = this.$modal.find('.modal-dialog'); + dialog.removeClass('dialog_full_screen'); + dialog.find('.dialog_button_restore').hide(); + dialog.find('.dialog_button_extend').show(); + }, -}); + }); }); diff --git a/web_environment_ribbon/static/src/js/ribbon.js b/web_environment_ribbon/static/src/js/ribbon.js index 9cd2e19c0c05..cbd6fa37c712 100644 --- a/web_environment_ribbon/static/src/js/ribbon.js +++ b/web_environment_ribbon/static/src/js/ribbon.js @@ -5,14 +5,14 @@ Copyright 2017 Xavier Jiménez License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ -odoo.define('web_environment_ribbon.ribbon', function(require) { -"use strict"; +odoo.define('web_environment_ribbon.ribbon', function (require) { + "use strict"; var rpc = require('web.rpc'); var core = require('web.core'); // Code from: http://jsfiddle.net/WK_of_Angmar/xgA5C/ - function validStrColour(strToTest) { + function validStrColour (strToTest) { if (strToTest === "") { return false; } @@ -53,7 +53,8 @@ odoo.define('web_environment_ribbon.ribbon', function(require) { ribbon.css('color', ribbon_data.color); } // Ribbon background color - if (ribbon_data.background_color && validStrColour(ribbon_data.background_color)) { + if (ribbon_data.background_color && + validStrColour(ribbon_data.background_color)) { ribbon.css('background-color', ribbon_data.background_color); } } diff --git a/web_responsive/__manifest__.py b/web_responsive/__manifest__.py index 6e93022bfb16..2720cb2d4af0 100644 --- a/web_responsive/__manifest__.py +++ b/web_responsive/__manifest__.py @@ -14,7 +14,7 @@ "installable": True, "depends": ["web", "mail"], "development_status": "Production/Stable", - "maintainers": ['Yajo', 'Tardo'], + "maintainers": ["Yajo", "Tardo"], "data": ["views/assets.xml", "views/res_users.xml", "views/web.xml"], "qweb": [ "static/src/xml/apps.xml",