Skip to content

Commit 944a4ac

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

File tree

7 files changed

+55
-33
lines changed

7 files changed

+55
-33
lines changed

web_pivot_computed_measure.zip

-35.1 KB
Binary file not shown.

web_widget_numeric_step/README.rst

Lines changed: 14 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,23 @@ 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
95+
96+
Known issues / Roadmap
97+
======================
98+
99+
When the value is entered using the keyboard, the limits set in the
100+
widget can be exceeded
95101

96102
Bug Tracker
97103
===========
98104

99105
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
100106
In case of trouble, please check there if your issue has already been reported.
101107
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**>`_.
108+
`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**>`_.
103109

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

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

153159
|maintainer-rafaelbn| |maintainer-yajo|
154160

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

157163
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",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
When the value is entered using the keyboard, the limits set in the widget can be exceeded

web_widget_numeric_step/static/description/index.html

Lines changed: 22 additions & 16 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>,
@@ -380,11 +380,12 @@ <h1 class="title">Web Widget Numeric Step</h1>
380380
<div class="contents local topic" id="contents">
381381
<ul class="simple">
382382
<li><a class="reference internal" href="#usage" id="toc-entry-1">Usage</a></li>
383-
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
384-
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
385-
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
386-
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
387-
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
383+
<li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-2">Known issues / Roadmap</a></li>
384+
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-3">Bug Tracker</a></li>
385+
<li><a class="reference internal" href="#credits" id="toc-entry-4">Credits</a><ul>
386+
<li><a class="reference internal" href="#authors" id="toc-entry-5">Authors</a></li>
387+
<li><a class="reference internal" href="#contributors" id="toc-entry-6">Contributors</a></li>
388+
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
388389
</ul>
389390
</li>
390391
</ul>
@@ -394,7 +395,7 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
394395
<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
395396
buttons “+” and “-” just next to the input field in edit mode. Iteration
396397
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>
398+
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/web/18.0/web_widget_numeric_step/static/description/add_two_buttons.png" /></p>
398399
<p><strong>Optional</strong></p>
399400
<p>Add an option to choose the step iteration and limits (min and max
400401
values).</p>
@@ -415,33 +416,38 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
415416
<p>Iteration with 0.25 step, min to -1 and max to 10.</p>
416417
<p>Start to increment with button, continue incrementing with scrolling
417418
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>
419+
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/web/18.0/web_widget_numeric_step/static/description/step0,25andlimits.gif" /></p>
419420
<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>
421+
<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>
421422
<p><strong>Demo</strong></p>
422423
<p>You can test the feature by going to Settings &gt; Technical &gt; Scheduled
423424
Actions. The field “Execute Every” is configured to use the widget with
424425
2 step, min to 0 and max to 40.</p>
425426
</div>
427+
<div class="section" id="known-issues-roadmap">
428+
<h1><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h1>
429+
<p>When the value is entered using the keyboard, the limits set in the
430+
widget can be exceeded</p>
431+
</div>
426432
<div class="section" id="bug-tracker">
427-
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
433+
<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
428434
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>.
429435
In case of trouble, please check there if your issue has already been reported.
430436
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>
437+
<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>
432438
<p>Do not contact contributors directly about support or help with technical issues.</p>
433439
</div>
434440
<div class="section" id="credits">
435-
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
441+
<h1><a class="toc-backref" href="#toc-entry-4">Credits</a></h1>
436442
<div class="section" id="authors">
437-
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
443+
<h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2>
438444
<ul class="simple">
439445
<li>GRAP</li>
440446
<li>Tecnativa</li>
441447
</ul>
442448
</div>
443449
<div class="section" id="contributors">
444-
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
450+
<h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
445451
<ul class="simple">
446452
<li><a class="reference external" href="http://www.grap.coop">GRAP</a>:<ul>
447453
<li>Quentin DUPONT &lt;<a class="reference external" href="mailto:quentin.dupont&#64;grap.coop">quentin.dupont&#64;grap.coop</a>&gt;</li>
@@ -458,7 +464,7 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
458464
</ul>
459465
</div>
460466
<div class="section" id="maintainers">
461-
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
467+
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
462468
<p>This module is maintained by the OCA.</p>
463469
<a class="reference external image-reference" href="https://odoo-community.org">
464470
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
@@ -468,7 +474,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
468474
promote its widespread use.</p>
469475
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
470476
<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>
477+
<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>
472478
<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>
473479
</div>
474480
</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)