[ADD] web_widget_uom

This commit is contained in:
Giovanni
2021-11-22 16:27:10 +01:00
parent 9621efda0d
commit 36028ceab2
19 changed files with 804 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
* Adria Gil Sorribes <adria.gil@eficent.com>
* Giovanni Serra <giovanni@gslab.it>

View File

@@ -0,0 +1,6 @@
This module allows the user to decide maximum
how many decimal places should be displayed in the Odoo User
Interface for each Unit of Measure.
If "Show only inputed decimals" is enabled on the UoM,
the widget will show inputed decimals up to Decimal Places.

View File

@@ -0,0 +1,3 @@
TODO
1. Add caching by uom.id

View File

@@ -0,0 +1,40 @@
In the UoM form view specify the number of decimal places that
should be displayed for each unit of Measure:
.. image:: ../static/description/UoMDecimalPlaces.png
:alt: Decimal Places in UoM form view
In the view declaration, put widget='uom' attribute in the field tag::
...
<field name="arch" type="xml">
<tree string="View name">
...
<field name="product_qty" widget="uom"/>
...
</tree>
</field>
...
<field name="arch" type="xml">
<form string="View name">
...
<field name="product_qty" widget="uom"/>
...
</form>
</field>
...
Widget Options::
...
<field name="arch" type="xml">
<tree string="View name">
...
<field name="product_qty" widget="uom" options="{'uom_field': 'product_uom'}"/>
...
</tree>
</field>
...
If the UoM field in the model is not declared under the name uom_id, the
option uom_field must be specified with the appropriate field name.