Web Datetime Picker Default Time

Allows to define a default time on datetime picker

Technical Name:
web_datetime_picker_default_time
Version:
16.0
License:
Author:
Camptocamp
https://odoo-community.org/web/image/product.template/716078/image_1920?unique=4711daf
  • Odoo Version

Terms and Conditions 

Web Datetime Picker Default Time

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

This module customizes the datetime picker widget and allows to define a default time to be applied in case the user selects only a Date.

For example, if a user wants to define a commitment date without having to specify the time on that date, setting the default time value on the field in the Form view allows to ensure the commitment date will be set to this time instead of the time when the page was loaded by the browser.

Table of contents

Usage

You can define the default time as follows for a static value:

<field name="your_datetime_field" options="{'defaultTime': {'hour': 8, 'minute': 30, 'second': 15 }}"/>

Otherwise you can also use a JSON field to make it dynamic through a compute function, and reference this field in the view:

start_time = field.Json(compute="_compute_start_time")

def _compute_start_time(self):
    for rec in self:
        rec.start_time = {'hour': 8, 'minute': 30, 'second': 15 }
<field name="start_time" invisible="1" />
<field name="your_datetime_field" options="{'defaultTime': 'start_time'}"/>

Known issues / Roadmap

  • Handle Timezone related to the default time

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • Camptocamp

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

Current maintainer:

grindtildeath

This module is part of the OCA/web project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

This is a preview of the recently viewed products by the user.
Once the user has seen at least one product this snippet will be visible.

Recently viewed Products