From 74fcd3ac3b0445c5fc0d9239900a9a41bfd04de8 Mon Sep 17 00:00:00 2001 From: svs-odoo Date: Tue, 4 Sep 2018 13:44:46 +0200 Subject: [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 --- doc/reference/javascript_reference.rst | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'doc/reference') 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 + + + + - 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 + + - float (FieldFloat) This is the default field type for fields of type *float*. @@ -1411,6 +1428,24 @@ order. + 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 + + + + - 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 + + + - 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, -- cgit v1.2.3