From e219515b923b4a273fe26059249dbbbdcaa44929 Mon Sep 17 00:00:00 2001 From: les-adhoc Date: Tue, 23 Jun 2026 13:56:03 +0000 Subject: [PATCH] [ADD] product_secondary_unit_ux: show secondary unit factor with more decimals The OCA 'product_secondary_unit' factor field has no digits, so the web client renders it with 2 decimals while storing full precision. This made the displayed value differ from the one actually used in conversions, causing confusion. New UX module forces the factor field to display 6 decimals (display-only, no change to storage or rounding). X-original-commit: 08ff153326545b8ad8dd42d80b17056fbb4f06d3 --- product_secondary_unit_ux/README.rst | 77 +++++++++++++++++++ product_secondary_unit_ux/__init__.py | 0 product_secondary_unit_ux/__manifest__.py | 39 ++++++++++ .../views/product_views.xml | 19 +++++ 4 files changed, 135 insertions(+) create mode 100644 product_secondary_unit_ux/README.rst create mode 100644 product_secondary_unit_ux/__init__.py create mode 100644 product_secondary_unit_ux/__manifest__.py create mode 100644 product_secondary_unit_ux/views/product_views.xml diff --git a/product_secondary_unit_ux/README.rst b/product_secondary_unit_ux/README.rst new file mode 100644 index 000000000..4975ad1d8 --- /dev/null +++ b/product_secondary_unit_ux/README.rst @@ -0,0 +1,77 @@ +.. |company| replace:: ADHOC SA + +.. |company_logo| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-logo.png + :alt: ADHOC SA + :target: https://www.adhoc.com.ar + +.. |icon| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-icon.png + +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :target: https://www.gnu.org/licenses/agpl + :alt: License: AGPL-3 + +========================= +Product Secondary Unit UX +========================= + +Usability improvements for the OCA module "Product Secondary Unit": + +#. Display the secondary unit "Factor" field with 6 decimals instead of the + default 2 decimals, so the user sees the real precision stored and used in + the conversions (e.g. ``0.444444`` instead of ``0.44``). This is a + display-only change: it does not modify how the value is stored or rounded. + +Installation +============ + +To install this module, you need to: + +#. Just install this module. + +Configuration +============= + +To configure this module, you need to: + +#. No configuration needed. + +Usage +===== + +To use this module, you need to: + +#. Enable the "Units of Measure" feature (group ``uom.group_uom``). +#. Open a product and, under the "Secondary Unit of Measure" section, add a + secondary unit. The "Factor" field is shown with 6 decimals. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: http://runbot.adhoc.com.ar/ + +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. + +Credits +======= + +Images +------ + +* |company| |icon| + +Contributors +------------ + +Maintainer +---------- + +|company_logo| + +This module is maintained by the |company|. + +To contribute to this module, please visit https://www.adhoc.com.ar. diff --git a/product_secondary_unit_ux/__init__.py b/product_secondary_unit_ux/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/product_secondary_unit_ux/__manifest__.py b/product_secondary_unit_ux/__manifest__.py new file mode 100644 index 000000000..e52728fda --- /dev/null +++ b/product_secondary_unit_ux/__manifest__.py @@ -0,0 +1,39 @@ +############################################################################## +# +# Copyright (C) 2026 ADHOC SA (http://www.adhoc.com.ar) +# All Rights Reserved. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +{ + "name": "Product Secondary Unit UX", + "version": "18.0.1.0.0", + "category": "Products", + "sequence": 14, + "summary": "", + "author": "ADHOC SA", + "website": "www.adhoc.com.ar", + "license": "AGPL-3", + "images": [], + "depends": [ + "product_secondary_unit", + ], + "data": [ + "views/product_views.xml", + ], + "installable": True, + "auto_install": True, + "application": False, +} diff --git a/product_secondary_unit_ux/views/product_views.xml b/product_secondary_unit_ux/views/product_views.xml new file mode 100644 index 000000000..914f39920 --- /dev/null +++ b/product_secondary_unit_ux/views/product_views.xml @@ -0,0 +1,19 @@ + + + + product.template.form.secondary.unit.factor.digits + product.template + + + + [16, 6] + + + +