From 886ae3dc55a0fa61368e9b74beaec6cd6fe749e0 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 12 Dec 2023 11:04:30 +0000 Subject: [PATCH] [FIX] web_widget_numeric_step: disable buttons on readonly fields Before this patch, if a field was readonly, the user could still use the +/- buttons to alter its value. Not good! @moduon MT-4396 --- web_widget_numeric_step/README.rst | 2 +- web_widget_numeric_step/__manifest__.py | 2 +- web_widget_numeric_step/static/description/index.html | 2 +- web_widget_numeric_step/static/src/xml/numeric_step.xml | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/web_widget_numeric_step/README.rst b/web_widget_numeric_step/README.rst index e4c55abdf..14be29306 100644 --- a/web_widget_numeric_step/README.rst +++ b/web_widget_numeric_step/README.rst @@ -7,7 +7,7 @@ Web Widget Numeric Step !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:c08fb28b580ac9ab7d0f86b19ed2ded973fdf39e527ecad4a74fd87e11689f6f + !! source digest: sha256:672d53d5bf482d0938c82f0a39d665f9f5d133fe3dd5401bcb9488ac95797c12 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/web_widget_numeric_step/__manifest__.py b/web_widget_numeric_step/__manifest__.py index 8693197e0..4634da56a 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": "16.0.1.0.1", + "version": "16.0.1.0.2", "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 65bbc0c62..c723fcee4 100644 --- a/web_widget_numeric_step/static/description/index.html +++ b/web_widget_numeric_step/static/description/index.html @@ -366,7 +366,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:c08fb28b580ac9ab7d0f86b19ed2ded973fdf39e527ecad4a74fd87e11689f6f +!! source digest: sha256:672d53d5bf482d0938c82f0a39d665f9f5d133fe3dd5401bcb9488ac95797c12 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

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 -). diff --git a/web_widget_numeric_step/static/src/xml/numeric_step.xml b/web_widget_numeric_step/static/src/xml/numeric_step.xml index de2c313fc..be8ebde7c 100644 --- a/web_widget_numeric_step/static/src/xml/numeric_step.xml +++ b/web_widget_numeric_step/static/src/xml/numeric_step.xml @@ -18,6 +18,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). title="Minus" type="button" data-mode="minus" + t-att-disabled="props.readonly" t-on-click="_onStepClick" /> @@ -39,6 +40,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). title="Plus" type="button" data-mode="plus" + t-att-disabled="props.readonly" t-on-click="_onStepClick" />