mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[ADD] web_widget_uom
This commit is contained in:
2
web_widget_uom/readme/CONTRIBUTORS.rst
Normal file
2
web_widget_uom/readme/CONTRIBUTORS.rst
Normal file
@@ -0,0 +1,2 @@
|
||||
* Adria Gil Sorribes <adria.gil@eficent.com>
|
||||
* Giovanni Serra <giovanni@gslab.it>
|
||||
6
web_widget_uom/readme/DESCRIPTION.rst
Normal file
6
web_widget_uom/readme/DESCRIPTION.rst
Normal 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.
|
||||
3
web_widget_uom/readme/ROADMAP.rst
Normal file
3
web_widget_uom/readme/ROADMAP.rst
Normal file
@@ -0,0 +1,3 @@
|
||||
TODO
|
||||
|
||||
1. Add caching by uom.id
|
||||
40
web_widget_uom/readme/USAGE.rst
Normal file
40
web_widget_uom/readme/USAGE.rst
Normal 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.
|
||||
Reference in New Issue
Block a user