summaryrefslogtreecommitdiff
path: root/doc/reference/javascript_reference.rst
diff options
context:
space:
mode:
authorjem-odoo <jem@openerp.com>2018-08-13 14:40:28 +0200
committerjem-odoo <jem@openerp.com>2018-08-13 14:40:28 +0200
commit58e4a58427c2aeba6398b5ff1940931abe33463e (patch)
tree95dfda263f1e120d6fc7d003e221de9fa7c013a4 /doc/reference/javascript_reference.rst
parent8db463d124a04f4264862a5cfd78c612064c8a34 (diff)
parentcce8e002f5085b290bd4142c259f3f9f9a5e7225 (diff)
[MERGE] hr_timesheet: log timesheet in any time UoM
Since uom management has been extract in a separated module, we can now add the possibility to use it without product. This commit brings the ability to record the timesheets in an different UoM than 'Hours'. The user can now set an encoding UoM for its timesheet on the company. This will display the timesheet field `unit_amount` with a different widget. For instance, timesheeting in hours will still use the traditionnal float_time widget, when timesheeting in 'Days' will displayed a toggle button with a range of defined possible values. The widget used by UoM is customizable on the UoM. The `unit_amount` field should now be decorated with the 'timesheet_uom' widget. This one will bind the correct widget (float_time, float_toggle, ...). If the encoding UoM has no widget associated, the fallback will be 'float_factor', using the uoM converstion factor. Everything will still be stored in the database in 'Hours' (the UoM set on the `project_mode_time_id` field on the company). For more details, please have a look at the subcommits. Task #39079 Closes #24893
Diffstat (limited to 'doc/reference/javascript_reference.rst')
-rw-r--r--doc/reference/javascript_reference.rst20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/reference/javascript_reference.rst b/doc/reference/javascript_reference.rst
index 6cbfd3563dd..14647955afa 100644
--- a/doc/reference/javascript_reference.rst
+++ b/doc/reference/javascript_reference.rst
@@ -1418,6 +1418,26 @@ order.
- Supported field types: *float*
+- float_factor (FieldFloatFactor)
+ This widget aims to display properly a float value that converted using a factor
+ given in its options. So, for example, the value saved in database is 0.5 and the
+ factor is 3, the widget value should be formatted as 1.5.
+
+ - Supported field types: *float*
+
+- float_toggle (FieldFloatToggle)
+ The goal of this widget is to replace the input field by a button containing a
+ range of possible values (given in the options). Each click allows the user to loop
+ in the range. The purpose here is to restrict the field value to a predefined selection.
+ Also, the widget support the factor conversion as the *float_factor* widget (Range values
+ should be the result of the conversion).
+
+ - Supported field types: *float*
+
+ .. code-block:: xml
+
+ <field name="days_to_close" widget="float_toggle" options='{"factor": 2, "range": [0, 4, 8]}'/>
+
- boolean (FieldBoolean)
This is the default field type for fields of type *boolean*.