Skip to Content
Time Widget
time_widget

Time Widget

Time picker widget for character fields.

  • Odoo 17
  • Tools & Administration
  • 17.0
1

Overview

This module adds a time picker field widget named flatpickr_time that developers can put on Char fields in any form view. Instead of typing a time by hand, the user picks hours and minutes from a small clock-style popup built on the bundled flatpickr library. It is a front-end-only module with no models, menus or security rules. Developers and consultants use it on custom modules that store a time of day in a text field. The benefit is consistent, error-free time entry.

2

Usage steps

  1. 1

    Install the widget

    Installing the module registers a new field widget in the Odoo web client fields registry. The bundled flatpickr script and stylesheet are loaded with the backend assets. No screens or menus are added.

    • Widget name: flatpickr_time
    • Bundled flatpickr library
    • No menus or models
  2. 2

    Apply it on a Char field

    A developer adds widget="flatpickr_time" to a Char field in a form view. The field then shows a time picker on click. The widget only works on Char fields.

    • Add widget attribute in XML
    • Works on Char fields
    • Time popup on click
  3. 3

    Pick the time

    The user opens the popup and picks hours and minutes, and the chosen value is written to the field as text. The value saves like any other field on the record.

    • Hours and minutes selection
    • Value stored as text
    • Saves with the record
  4. 4

    Guard against wrong field types

    If the widget is placed on a field that is not a Char field, the widget shows a notice that it can only be added to Char fields. This protects forms from misconfiguration during development.

    • Notice on wrong field type
    • Prevents misuse
    • Developer-facing message
4

Roles

Benefiting roles
Role
Developer
Functional consultant
End user
5

Dependencies

Back to version applications

Want to know more or try this app? Contact us

We can arrange a demo or a trial and answer your questions about Time Widget.

Contact us