diff --git a/web_pivot_computed_measure.zip b/web_pivot_computed_measure.zip deleted file mode 100644 index 0244e21ca76e..000000000000 Binary files a/web_pivot_computed_measure.zip and /dev/null differ diff --git a/web_widget_numeric_step/README.rst b/web_widget_numeric_step/README.rst index b5ddc5dc2ecd..a15e05e63b13 100644 --- a/web_widget_numeric_step/README.rst +++ b/web_widget_numeric_step/README.rst @@ -17,13 +17,13 @@ Web Widget Numeric Step :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/17.0/web_widget_numeric_step + :target: https://github.com/OCA/web/tree/18.0/web_widget_numeric_step :alt: OCA/web .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/web-17-0/web-17-0-web_widget_numeric_step + :target: https://translation.odoo-community.org/projects/web-18-0/web-18-0-web_widget_numeric_step :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=17.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -89,9 +89,9 @@ You can test the feature by going to Settings > Technical > Scheduled Actions. The field "Execute Every" is configured to use the widget with 2 step, min to 0 and max to 40. -.. |image1| image:: https://raw.githubusercontent.com/OCA/web/17.0/web_widget_numeric_step/static/description/add_two_buttons.png -.. |image2| image:: https://raw.githubusercontent.com/OCA/web/17.0/web_widget_numeric_step/static/description/step0,25andlimits.gif -.. |image3| image:: https://raw.githubusercontent.com/OCA/web/17.0/web_widget_numeric_step/static/description/step10_limit15_placeholder117_with_onchange.gif +.. |image1| image:: https://raw.githubusercontent.com/OCA/web/18.0/web_widget_numeric_step/static/description/add_two_buttons.png +.. |image2| image:: https://raw.githubusercontent.com/OCA/web/18.0/web_widget_numeric_step/static/description/step0,25andlimits.gif +.. |image3| image:: https://raw.githubusercontent.com/OCA/web/18.0/web_widget_numeric_step/static/description/step10_limit15_placeholder117_with_onchange.gif Bug Tracker =========== @@ -99,7 +99,7 @@ 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 to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -152,6 +152,6 @@ Current `maintainers `__: |maintainer-rafaelbn| |maintainer-yajo| -This module is part of the `OCA/web `_ project on GitHub. +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_widget_numeric_step/__manifest__.py b/web_widget_numeric_step/__manifest__.py index 63555bc54146..d1cf0ae3e2f5 100644 --- a/web_widget_numeric_step/__manifest__.py +++ b/web_widget_numeric_step/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Web Widget Numeric Step", "category": "web", - "version": "17.0.1.0.0", + "version": "18.0.1.0.0", "author": "GRAP, Tecnativa, Odoo Community Association (OCA)", "license": "AGPL-3", "website": "https://github.com/OCA/web", diff --git a/web_widget_numeric_step/static/description/index.html b/web_widget_numeric_step/static/description/index.html index 8b24125bf372..beda192b7bfa 100644 --- a/web_widget_numeric_step/static/description/index.html +++ b/web_widget_numeric_step/static/description/index.html @@ -369,7 +369,7 @@

Web Widget Numeric Step

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:1062d0c26bb10198c524113d70fa069c5928514e9569f607316544fee88bb6d9 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

This widget changes input number field and make it easier to increment the number thanks to 2 buttons (+ and -). Use JS native logic for input number, so you can use the options min, max, step, @@ -394,7 +394,7 @@

Usage

In your xml view, add widget="numeric_step" This will add the 2 buttons “+” and “-” just next to the input field in edit mode. Iteration step by default is 1.

-

image1

+

image1

Optional

Add an option to choose the step iteration and limits (min and max values).

@@ -415,9 +415,9 @@

Usage

Iteration with 0.25 step, min to -1 and max to 10.

Start to increment with button, continue incrementing with scrolling mouse.

-

image2

+

image2

Iteration with 10 step, max limit 15, placeholder with onchange

-

image3

+

image3

Demo

You can test the feature by going to Settings > Technical > Scheduled Actions. The field “Execute Every” is configured to use the widget with @@ -428,7 +428,7 @@

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 to smash it by providing a detailed and welcomed -feedback.

+feedback.

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

@@ -468,7 +468,7 @@

Maintainers

promote its widespread use.

Current maintainers:

rafaelbn yajo

-

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

+

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_widget_numeric_step/static/src/numeric_step.esm.js b/web_widget_numeric_step/static/src/numeric_step.esm.js index f4c885c94c82..986c0d9dda84 100644 --- a/web_widget_numeric_step/static/src/numeric_step.esm.js +++ b/web_widget_numeric_step/static/src/numeric_step.esm.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import {_lt} from "@web/core/l10n/translation"; +import {_t} from "@web/core/l10n/translation"; import {registry} from "@web/core/registry"; import {FloatField} from "@web/views/fields/float/float_field"; import {standardFieldProps} from "@web/views/fields/standard_field_props"; @@ -10,7 +10,7 @@ export class NumericStep extends FloatField { super.setup(); } _onStepClick(ev) { - const mode = $(ev.target).data("mode"); + const mode = ev.target.dataset.mode; this._doStep(mode); } _onKeyDown(ev) { @@ -22,10 +22,19 @@ export class NumericStep extends FloatField { } _onWheel(ev) { ev.preventDefault(); - if (ev.deltaY > 0) { - this._doStep("minus"); - } else { - this._doStep("plus"); + if (!this._lastWheelTime) { + this._lastWheelTime = 0; + } + const now = Date.now(); + const throttleLimit = 100; + if (now - this._lastWheelTime >= throttleLimit) { + this._lastWheelTime = now; + + if (ev.deltaY > 0) { + this._doStep("minus"); + } else { + this._doStep("plus"); + } } } updateField(val) { @@ -64,7 +73,7 @@ NumericStep.defaultProps = { export const numericStep = { component: NumericStep, supportedTypes: ["float"], - displayName: _lt("Numeric Step"), + displayName: _t("Numeric Step"), extractProps: ({attrs, options}) => { return { name: attrs.name, diff --git a/web_widget_numeric_step/static/src/numeric_step.xml b/web_widget_numeric_step/static/src/numeric_step.xml index e8d6e75fe965..51c4b05ad835 100644 --- a/web_widget_numeric_step/static/src/numeric_step.xml +++ b/web_widget_numeric_step/static/src/numeric_step.xml @@ -5,7 +5,7 @@ Copyright 2020 Tecnativa - Alexandre Díaz License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->