Allows to define a default time on datetime picker
Project description
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
Contributors
Akim Juillerat akim.juillerat@camptocamp.com
Iván Todorovich ivan.todorovich@camptocamp.com
Maintainers
This module is maintained by the OCA.
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:
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file odoo_addon_web_datetime_picker_default_time-16.0.1.0.0.4-py3-none-any.whl
.
File metadata
- Download URL: odoo_addon_web_datetime_picker_default_time-16.0.1.0.0.4-py3-none-any.whl
- Upload date:
- Size: 25.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8792bbc28940c3fa25d1351f6a050d3c5be7ddaa12c6023c01cba731eaebe271 |
|
MD5 | 43735f0d608d3a77ae6262c07bec1cf0 |
|
BLAKE2b-256 | 1238d0d9502a46ba4c2572a66297ab7ebe3883a1a57fdce5f18df7891d4de107 |