You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
1.8 KiB

  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
  3. :alt: License: AGPL-3
  4. ===============================
  5. Timepicker widget in form views
  6. ===============================
  7. This module provides a timepicker widget for float fields.
  8. It can be used as a replacement for the standard float_time widget in form views.
  9. |picker|
  10. The widget has the following default timepicker options:
  11. * the possible selection is based on 15 minute interval (step: 15)
  12. * 24 hour mode in H:i format (timeFormat: 'H:i')
  13. * scroll selection starts at current time (scrollDefault: 'now')
  14. |formview|
  15. Usage
  16. =====
  17. In the form view declaration, put widget='timepicker' attribute in the field tag::
  18. ...
  19. <field name="arch" type="xml">
  20. <form string="View name">
  21. ...
  22. <field name="name"/>
  23. <field name="mytimefieldname" widget="timepicker"/>
  24. ...
  25. </form>
  26. </field>
  27. ...
  28. Additional jquery-timepicker plugin options can be specified by an options attribute::
  29. ...
  30. <field name="mytimefieldname" widget="timepicker" options="{'step': '30', 'disableTextInput': false}"/>
  31. ...
  32. See the available options at `jquery-timepicker <https://github.com//jonthornton//jquery-timepicker#timepicker-plugin-for-jquery>`_.
  33. .. |picker| image:: ./images/picker.png
  34. .. |formview| image:: ./images/form_view.png
  35. Known issues / Roadmap
  36. ======================
  37. * No validation on options.
  38. Credits
  39. =======
  40. * 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
  41. * Odoo Community Association (OCA)
  42. Contributors
  43. ------------
  44. * Michael Fried <Michael.Fried@vividlab.de>