|
1 | 1 | .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
|
2 |
| - :alt: License: AGPL-3 |
| 2 | + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html |
| 3 | + :alt: License: AGPL-3 |
3 | 4 |
|
4 |
| -============================== |
5 |
| -Timepicker widget in form view |
6 |
| -============================== |
7 | 5 |
|
8 |
| -This module defines a timepicker widget, to be used with float fields |
9 |
| -or (function) fields. Use ``widget='timepicker'`` in your form view |
10 |
| -definition. It can be use as a replacement for the standard float_time widget. |
| 6 | +=============================== |
| 7 | +Timepicker widget in form views |
| 8 | +=============================== |
11 | 9 |
|
12 |
| -If you use the widget with a field record, the input field has the following default |
13 |
| -timepicker options: |
| 10 | +This module provides a timepicker widget for float fields. |
| 11 | +It can be used as a replacement for the standard float_time widget in form views. |
14 | 12 |
|
15 |
| -* By default the possible selection is based on 15 minute interval (step: 15) |
16 |
| -* By default 24 hour mode with H:i format (timeFormat: 'H:i') |
17 |
| -* By default scroll selection starts at current time (scrollDefault: 'now') |
18 | 13 |
|
19 |
| -The widget uses the jquery.timepicker plugin by Jon Thornton |
| 14 | +|picker| |
| 15 | + |
| 16 | + |
| 17 | +The widget has the following default timepicker options: |
| 18 | + |
| 19 | +* the possible selection is based on 15 minute interval (step: 15) |
| 20 | +* 24 hour mode in H:i format (timeFormat: 'H:i') |
| 21 | +* scroll selection starts at current time (scrollDefault: 'now') |
| 22 | + |
| 23 | + |
| 24 | +|formview| |
20 | 25 |
|
21 | 26 |
|
22 | 27 | Usage
|
23 | 28 | =====
|
24 | 29 |
|
25 |
| -This module defines a new widget type for form views input fileds. |
26 |
| -Set the attribute ``widget=timepicker`` in a ``field`` tag in a form view. |
| 30 | +In the form view declaration, put widget='timepicker' attribute in the field tag:: |
27 | 31 |
|
28 |
| -You can pass custom options through the "timepicker" field in the options attribute: |
| 32 | + ... |
| 33 | + <field name="arch" type="xml"> |
| 34 | + <form string="View name"> |
| 35 | + ... |
| 36 | + <field name="name"/> |
| 37 | + <field name="mytimefieldname" widget="timepicker"/> |
| 38 | + ... |
| 39 | + </form> |
| 40 | + </field> |
| 41 | + ... |
| 42 | + |
| 43 | +Additional jquery-timepicker plugin options can be specified by an options attribute:: |
29 | 44 |
|
30 | 45 | ...
|
31 |
| - <field name="mytimefieldname" `widget=timepicker`` options="{'step': '30', 'disableTextInput': false}"/> |
| 46 | + <field name="mytimefieldname" widget="timepicker" options="{'step': '30', 'disableTextInput': false}"/> |
32 | 47 | ...
|
33 | 48 |
|
34 |
| -See the available options at https://github.com/jonthornton/jquery-timepicker#timepicker-plugin-for-jquery. |
| 49 | +See the available options at `jquery-timepicker <https://github.com//jonthornton//jquery-timepicker#timepicker-plugin-for-jquery>`_. |
| 50 | + |
| 51 | +.. |picker| image:: ./images/picker.png |
| 52 | +.. |formview| image:: ./images/form_view.png |
35 | 53 |
|
36 | 54 |
|
37 | 55 | Known issues / Roadmap
|
38 | 56 | ======================
|
39 | 57 |
|
40 |
| -* Absolutely no sanity check or validation on options. |
| 58 | +* No validation on options. |
41 | 59 |
|
42 | 60 |
|
43 | 61 | Credits
|
44 | 62 | =======
|
45 | 63 |
|
46 |
| -Jon Thornton (https://cdnjs.com/libraries/jquery-timepicker) |
47 |
| -jquery.timepicker plugin - This software is made available under the open source MIT License. © 2014 Jon Thornton and contributors |
| 64 | +* The module uses the `jquery-timepicker <https://cdnjs.com//libraries//jquery-timepicker>`_ plugin by Jon Thornton. This software is made available under the open source MIT License. © 2014 Jon Thornton and contributors |
48 | 65 |
|
49 |
| -Odoo Community Association (OCA) |
| 66 | +* Odoo Community Association (OCA) |
50 | 67 |
|
51 | 68 |
|
52 | 69 | Contributors
|
53 | 70 | ------------
|
54 | 71 |
|
55 |
| -* Michael Fried |
| 72 | +* Michael Fried <Michael.Fried@vividlab.de> |
0 commit comments