summaryrefslogtreecommitdiff
path: root/doc/reference/javascript_reference.rst
diff options
context:
space:
mode:
authorsvs-odoo <svs@odoo.com>2018-09-04 13:44:46 +0200
committerGéry Debongnie <ged@odoo.com>2018-09-07 16:18:45 +0200
commit74fcd3ac3b0445c5fc0d9239900a9a41bfd04de8 (patch)
tree041014b3bceaa5433108bcce74ad83557a19fad8 /doc/reference/javascript_reference.rst
parent16aeecc73d4cf95e55f447315c983fae4ca471f7 (diff)
[IMP] web: FieldInteger and FieldFloat can use input of type number
This allow the browser/device to handle the experience of handling number in a more native way. FieldInteger and FieldFloat now inherits from NumericField because we want to format it or not dependent of the view (readonly or edit) and the NumericField will manage it. We do that because input type number can't take a value with comma on Chrome (FireFox is more permissive but not perfect because comma is the separator for decimal in this case). Task #1880376
Diffstat (limited to 'doc/reference/javascript_reference.rst')
-rw-r--r--doc/reference/javascript_reference.rst35
1 files changed, 35 insertions, 0 deletions
diff --git a/doc/reference/javascript_reference.rst b/doc/reference/javascript_reference.rst
index 14647955afa..c1f2ae9cb0d 100644
--- a/doc/reference/javascript_reference.rst
+++ b/doc/reference/javascript_reference.rst
@@ -1397,6 +1397,23 @@ order.
- Supported field types: *integer*
+ Options:
+
+ - type: setting the input type (*text* by default, can be set on *number*)
+ On edit mode, the field is rendered as an input with the HTML attribute type
+ setted on *number* (so user can benefit the native support, especially on
+ mobile). In this case, the default formatting is disabled to avoid incompability.
+
+ .. code-block:: xml
+
+ <field name="int_value" options='{"type": "number"}'/>
+
+ - step: set the step to the value up and down when the user click on buttons
+ (only for input of type number, 1 by default)
+
+ .. code-block:: xml
+
+ <field name="int_value" options='{"type": "number", "step": 100}'/>
- float (FieldFloat)
This is the default field type for fields of type *float*.
@@ -1411,6 +1428,24 @@ order.
<field name="factor" digits="[42,5]"/>
+ Options:
+
+ - type: setting the input type (*text* by default, can be set on *number*)
+ On edit mode, the field is rendered as an input with the HTML attribute type
+ setted on *number* (so user can benefit the native support, especially on
+ mobile). In this case, the default formatting is disabled to avoid incompability.
+
+ .. code-block:: xml
+
+ <field name="int_value" options='{"type": "number"}'/>
+
+ - step: set the step to the value up and down when the user click on buttons
+ (only for input of type number, 1 by default)
+
+ .. code-block:: xml
+
+ <field name="int_value" options='{"type": "number", "step": 0.1}'/>
+
- float_time (FieldFloatTime)
The goal of this widget is to display properly a float value that represents
a time interval (in hours). So, for example, 0.5 should be formatted as 0:30,