Skip to content

Commit e3e7acc

Browse files
committed
[MIG] web_widget_numeric_step: Migration to 18.0
1 parent 0889f10 commit e3e7acc

File tree

6 files changed

+32
-23
lines changed

6 files changed

+32
-23
lines changed

web_pivot_computed_measure.zip

-35.1 KB
Binary file not shown.

web_widget_numeric_step/README.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Web Widget Numeric Step
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
20-
:target: https://github.com/OCA/web/tree/17.0/web_widget_numeric_step
20+
:target: https://github.com/OCA/web/tree/18.0/web_widget_numeric_step
2121
:alt: OCA/web
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/web-17-0/web-17-0-web_widget_numeric_step
23+
:target: https://translation.odoo-community.org/projects/web-18-0/web-18-0-web_widget_numeric_step
2424
:alt: Translate me on Weblate
2525
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=17.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=18.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -89,17 +89,17 @@ You can test the feature by going to Settings > Technical > Scheduled
8989
Actions. The field "Execute Every" is configured to use the widget with
9090
2 step, min to 0 and max to 40.
9191

92-
.. |image1| image:: https://raw.githubusercontent.com/OCA/web/17.0/web_widget_numeric_step/static/description/add_two_buttons.png
93-
.. |image2| image:: https://raw.githubusercontent.com/OCA/web/17.0/web_widget_numeric_step/static/description/step0,25andlimits.gif
94-
.. |image3| image:: https://raw.githubusercontent.com/OCA/web/17.0/web_widget_numeric_step/static/description/step10_limit15_placeholder117_with_onchange.gif
92+
.. |image1| image:: https://raw.githubusercontent.com/OCA/web/18.0/web_widget_numeric_step/static/description/add_two_buttons.png
93+
.. |image2| image:: https://raw.githubusercontent.com/OCA/web/18.0/web_widget_numeric_step/static/description/step0,25andlimits.gif
94+
.. |image3| image:: https://raw.githubusercontent.com/OCA/web/18.0/web_widget_numeric_step/static/description/step10_limit15_placeholder117_with_onchange.gif
9595

9696
Bug Tracker
9797
===========
9898

9999
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
100100
In case of trouble, please check there if your issue has already been reported.
101101
If you spotted it first, help us to smash it by providing a detailed and welcomed
102-
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_widget_numeric_step%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
102+
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_widget_numeric_step%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
103103

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

@@ -152,6 +152,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
152152

153153
|maintainer-rafaelbn| |maintainer-yajo|
154154

155-
This module is part of the `OCA/web <https://github.com/OCA/web/tree/17.0/web_widget_numeric_step>`_ project on GitHub.
155+
This module is part of the `OCA/web <https://github.com/OCA/web/tree/18.0/web_widget_numeric_step>`_ project on GitHub.
156156

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

web_widget_numeric_step/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{
66
"name": "Web Widget Numeric Step",
77
"category": "web",
8-
"version": "17.0.1.0.0",
8+
"version": "18.0.1.0.0",
99
"author": "GRAP, Tecnativa, Odoo Community Association (OCA)",
1010
"license": "AGPL-3",
1111
"website": "https://github.com/OCA/web",

web_widget_numeric_step/static/description/index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ <h1 class="title">Web Widget Numeric Step</h1>
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370370
!! source digest: sha256:1062d0c26bb10198c524113d70fa069c5928514e9569f607316544fee88bb6d9
371371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/web/tree/17.0/web_widget_numeric_step"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/web-17-0/web-17-0-web_widget_numeric_step"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/web&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/web/tree/18.0/web_widget_numeric_step"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/web-18-0/web-18-0-web_widget_numeric_step"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/web&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373373
<p>This widget changes input number field and make it easier to increment
374374
the number thanks to 2 buttons (+ and -). Use JS native logic for input
375375
number, so you can use the options <tt class="docutils literal">min</tt>, <tt class="docutils literal">max</tt>, <tt class="docutils literal">step</tt>,
@@ -394,7 +394,7 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
394394
<p>In your xml view, add <tt class="docutils literal"><span class="pre">widget=&quot;numeric_step&quot;</span></tt> This will add the 2
395395
buttons “+” and “-” just next to the input field in edit mode. Iteration
396396
step by default is 1.</p>
397-
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/web/17.0/web_widget_numeric_step/static/description/add_two_buttons.png" /></p>
397+
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/web/18.0/web_widget_numeric_step/static/description/add_two_buttons.png" /></p>
398398
<p><strong>Optional</strong></p>
399399
<p>Add an option to choose the step iteration and limits (min and max
400400
values).</p>
@@ -415,9 +415,9 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
415415
<p>Iteration with 0.25 step, min to -1 and max to 10.</p>
416416
<p>Start to increment with button, continue incrementing with scrolling
417417
mouse.</p>
418-
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/web/17.0/web_widget_numeric_step/static/description/step0,25andlimits.gif" /></p>
418+
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/web/18.0/web_widget_numeric_step/static/description/step0,25andlimits.gif" /></p>
419419
<p>Iteration with 10 step, max limit 15, placeholder with onchange</p>
420-
<p><img alt="image3" src="https://raw.githubusercontent.com/OCA/web/17.0/web_widget_numeric_step/static/description/step10_limit15_placeholder117_with_onchange.gif" /></p>
420+
<p><img alt="image3" src="https://raw.githubusercontent.com/OCA/web/18.0/web_widget_numeric_step/static/description/step10_limit15_placeholder117_with_onchange.gif" /></p>
421421
<p><strong>Demo</strong></p>
422422
<p>You can test the feature by going to Settings &gt; Technical &gt; Scheduled
423423
Actions. The field “Execute Every” is configured to use the widget with
@@ -428,7 +428,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
428428
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>.
429429
In case of trouble, please check there if your issue has already been reported.
430430
If you spotted it first, help us to smash it by providing a detailed and welcomed
431-
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_widget_numeric_step%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
431+
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_widget_numeric_step%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
432432
<p>Do not contact contributors directly about support or help with technical issues.</p>
433433
</div>
434434
<div class="section" id="credits">
@@ -468,7 +468,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
468468
promote its widespread use.</p>
469469
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
470470
<p><a class="reference external image-reference" href="https://github.com/rafaelbn"><img alt="rafaelbn" src="https://github.com/rafaelbn.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/yajo"><img alt="yajo" src="https://github.com/yajo.png?size=40px" /></a></p>
471-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/17.0/web_widget_numeric_step">OCA/web</a> project on GitHub.</p>
471+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/18.0/web_widget_numeric_step">OCA/web</a> project on GitHub.</p>
472472
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
473473
</div>
474474
</div>

web_widget_numeric_step/static/src/numeric_step.esm.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @odoo-module */
22

3-
import {_lt} from "@web/core/l10n/translation";
3+
import {_t} from "@web/core/l10n/translation";
44
import {registry} from "@web/core/registry";
55
import {FloatField} from "@web/views/fields/float/float_field";
66
import {standardFieldProps} from "@web/views/fields/standard_field_props";
@@ -10,7 +10,7 @@ export class NumericStep extends FloatField {
1010
super.setup();
1111
}
1212
_onStepClick(ev) {
13-
const mode = $(ev.target).data("mode");
13+
const mode = ev.target.dataset.mode;
1414
this._doStep(mode);
1515
}
1616
_onKeyDown(ev) {
@@ -22,10 +22,19 @@ export class NumericStep extends FloatField {
2222
}
2323
_onWheel(ev) {
2424
ev.preventDefault();
25-
if (ev.deltaY > 0) {
26-
this._doStep("minus");
27-
} else {
28-
this._doStep("plus");
25+
if (!this._lastWheelTime) {
26+
this._lastWheelTime = 0;
27+
}
28+
const now = Date.now();
29+
const throttleLimit = 100;
30+
if (now - this._lastWheelTime >= throttleLimit) {
31+
this._lastWheelTime = now;
32+
33+
if (ev.deltaY > 0) {
34+
this._doStep("minus");
35+
} else {
36+
this._doStep("plus");
37+
}
2938
}
3039
}
3140
updateField(val) {
@@ -64,7 +73,7 @@ NumericStep.defaultProps = {
6473
export const numericStep = {
6574
component: NumericStep,
6675
supportedTypes: ["float"],
67-
displayName: _lt("Numeric Step"),
76+
displayName: _t("Numeric Step"),
6877
extractProps: ({attrs, options}) => {
6978
return {
7079
name: attrs.name,

web_widget_numeric_step/static/src/numeric_step.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Copyright 2020 Tecnativa - Alexandre Díaz
55
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
66
-->
77
<template>
8-
<t t-name="web_widget_numeric_step" owl="1">
8+
<t t-name="web_widget_numeric_step">
99
<div class="d-flex widget_numeric_step">
1010
<div class="input-group-prepend widget_numeric_step_btn">
1111
<button

0 commit comments

Comments
 (0)