@@ -369,7 +369,7 @@ <h1 class="title">Web Datetime Picker Default Time</h1>
369
369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370
370
!! source digest: sha256:a5ffb697bdf4c26817212f783a9d4d617e91fcdc912a7750382d3eddaff05f7b
371
371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372
- < p > < a class ="reference external image-reference " href ="https://odoo-community.org/page/development-status "> < img alt ="Beta " src ="https://img.shields.io/badge/maturity-Beta-yellow.png " /> </ a > < a class ="reference external image-reference " href ="http://www.gnu.org/licenses/agpl-3.0-standalone.html "> < img alt ="License: AGPL-3 " src ="https://img.shields.io/badge/licence-AGPL--3-blue.png " /> </ a > < a class ="reference external image-reference " href ="https://github.com/OCA/web/tree/16.0/web_datetime_picker_default_time "> < img alt ="OCA/web " src ="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github " /> </ a > < a class ="reference external image-reference " href ="https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_datetime_picker_default_time "> < img alt ="Translate me on Weblate " src ="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png " /> </ a > < a class ="reference external image-reference " href ="https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=16.0 "> < img alt ="Try me on Runboat " src ="https://img.shields.io/badge/runboat-Try%20me-875A7B.png " /> </ a > </ p >
372
+ < p > < a class ="reference external image-reference " href ="https://odoo-community.org/page/development-status "> < img alt ="Beta " src ="https://img.shields.io/badge/maturity-Beta-yellow.png " /> </ a > < a class ="reference external image-reference " href ="http://www.gnu.org/licenses/agpl-3.0-standalone.html "> < img alt ="License: AGPL-3 " src ="https://img.shields.io/badge/licence-AGPL--3-blue.png " /> </ a > < a class ="reference external image-reference " href ="https://github.com/OCA/web/tree/18.0/web_datetime_picker_default_time "> < img alt ="OCA/web " src ="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github " /> </ a > < a class ="reference external image-reference " href ="https://translation.odoo-community.org/projects/web-18-0/web-18-0-web_datetime_picker_default_time "> < img alt ="Translate me on Weblate " src ="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png " /> </ a > < a class ="reference external image-reference " href ="https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=18.0 "> < img alt ="Try me on Runboat " src ="https://img.shields.io/badge/runboat-Try%20me-875A7B.png " /> </ a > </ p >
373
373
< p > This module customizes the datetime picker widget and allows to define a
374
374
default time to be applied in case the user selects only a Date.</ p >
375
375
< p > For example, if a user wants to define a commitment date without having
@@ -386,19 +386,26 @@ <h1 class="title">Web Datetime Picker Default Time</h1>
386
386
< li > < a class ="reference internal " href ="#credits " id ="toc-entry-4 "> Credits</ a > < ul >
387
387
< li > < a class ="reference internal " href ="#authors " id ="toc-entry-5 "> Authors</ a > </ li >
388
388
< li > < a class ="reference internal " href ="#contributors " id ="toc-entry-6 "> Contributors</ a > </ li >
389
- < li > < a class ="reference internal " href ="#maintainers " id ="toc-entry-7 "> Maintainers</ a > </ li >
389
+ < li > < a class ="reference internal " href ="#other-credits " id ="toc-entry-7 "> Other credits</ a > </ li >
390
+ < li > < a class ="reference internal " href ="#maintainers " id ="toc-entry-8 "> Maintainers</ a > </ li >
390
391
</ ul >
391
392
</ li >
392
393
</ ul >
393
394
</ div >
394
395
< div class ="section " id ="usage ">
395
396
< h1 > < a class ="toc-backref " href ="#toc-entry-1 "> Usage</ a > </ h1 >
396
- < p > You can define the default time as follows for a static value:</ p >
397
+ < p > < strong > Static Default Time</ strong > You can define the default time as follows for a
398
+ static value For < tt class ="docutils literal "> < span class ="pre "> widget="datetime"</ span > </ tt > :</ p >
397
399
< pre class ="code xml literal-block ">
398
- < span class ="nt "> <field</ span > < span class ="w "> </ span > < span class ="na "> name=</ span > < span class ="s "> "your_datetime_field"</ span > < span class ="w "> </ span > < span class ="na "> options=</ span > < span class ="s "> "{'defaultTime': {'hour': 8, 'minute': 30, 'second': 15 }}"</ span > < span class ="nt "> /></ span >
400
+ < span class ="nt "> <field</ span > < span class ="w "> </ span > < span class ="na "> name=</ span > < span class ="s "> "your_datetime_field"</ span > < span class ="w "> </ span > < span class ="na "> widget= </ span > < span class =" s " > "datetime" </ span > < span class =" w " > </ span > < span class =" na " > options=</ span > < span class ="s "> "{'defaultTime': {'hour': 8, 'minute': 30, 'second': 15 }}"</ span > < span class ="nt "> /></ span >
399
401
</ pre >
400
- < p > Otherwise you can also use a JSON field to make it dynamic through a
401
- compute function, and reference this field in the view:</ p >
402
+ < p > For < tt class ="docutils literal "> < span class ="pre "> widget="daterange"</ span > </ tt > :</ p >
403
+ < pre class ="code xml literal-block ">
404
+ < span class ="nt "> <field</ span > < span class ="w "> </ span > < span class ="na "> name=</ span > < span class ="s "> "your_start_datetime_field"</ span > < span class ="w "> </ span > < span class ="na "> widget=</ span > < span class ="s "> "datetime"</ span > < span class ="w "> </ span > < span class ="na "> options=</ span > < span class ="s "> "{'end_date_field': 'your_end_datetime_field', 'defaultStartTime': {'hour': 2, 'minute': 22, 'second': 22,}, 'defaultEndTime': {'hour': 3, 'minute': 33, 'second': 33,}}"</ span > < span class ="nt "> /></ span >
405
+ </ pre >
406
+ < p > < strong > Dynamic Default Time</ strong > Otherwise you can also use a JSON field to make
407
+ it dynamic through a compute function, and reference this field in the
408
+ view:</ p >
402
409
< pre class ="code python literal-block ">
403
410
< span class ="n "> start_time</ span > < span class ="o "> =</ span > < span class ="n "> field</ span > < span class ="o "> .</ span > < span class ="n "> Json</ span > < span class ="p "> (</ span > < span class ="n "> compute</ span > < span class ="o "> =</ span > < span class ="s2 "> "_compute_start_time"</ span > < span class ="p "> )</ span > < span class ="w ">
404
411
@@ -422,7 +429,7 @@ <h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
422
429
< p > Bugs are tracked on < a class ="reference external " href ="https://github.com/OCA/web/issues "> GitHub Issues</ a > .
423
430
In case of trouble, please check there if your issue has already been reported.
424
431
If you spotted it first, help us to smash it by providing a detailed and welcomed
425
- < a class ="reference external " href ="https://github.com/OCA/web/issues/new?body=module:%20web_datetime_picker_default_time%0Aversion:%2016 .0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior** "> feedback</ a > .</ p >
432
+ < a class ="reference external " href ="https://github.com/OCA/web/issues/new?body=module:%20web_datetime_picker_default_time%0Aversion:%2018 .0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior** "> feedback</ a > .</ p >
426
433
< p > Do not contact contributors directly about support or help with technical issues.</ p >
427
434
</ div >
428
435
< div class ="section " id ="credits ">
@@ -438,10 +445,19 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
438
445
< ul class ="simple ">
439
446
< li > Akim Juillerat < a class ="reference external " href ="mailto:akim.juillerat@camptocamp.com "> akim.juillerat@camptocamp.com</ a > </ li >
440
447
< li > Iván Todorovich < a class ="reference external " href ="mailto:ivan.todorovich@camptocamp.com "> ivan.todorovich@camptocamp.com</ a > </ li >
448
+ < li > < a class ="reference external " href ="https://trobz.com "> Trobz</ a > :< ul >
449
+ < li > Tuan Nguyen << a class ="reference external " href ="mailto:tuanna@trobz.com "> tuanna@trobz.com</ a > ></ li >
441
450
</ ul >
451
+ </ li >
452
+ </ ul >
453
+ </ div >
454
+ < div class ="section " id ="other-credits ">
455
+ < h2 > < a class ="toc-backref " href ="#toc-entry-7 "> Other credits</ a > </ h2 >
456
+ < p > The migration of this module from 16.0 to 18.0 was financially supported
457
+ by Camptocamp.</ p >
442
458
</ div >
443
459
< div class ="section " id ="maintainers ">
444
- < h2 > < a class ="toc-backref " href ="#toc-entry-7 "> Maintainers</ a > </ h2 >
460
+ < h2 > < a class ="toc-backref " href ="#toc-entry-8 "> Maintainers</ a > </ h2 >
445
461
< p > This module is maintained by the OCA.</ p >
446
462
< a class ="reference external image-reference " href ="https://odoo-community.org ">
447
463
< img alt ="Odoo Community Association " src ="https://odoo-community.org/logo.png " />
@@ -451,7 +467,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
451
467
promote its widespread use.</ p >
452
468
< p > Current < a class ="reference external " href ="https://odoo-community.org/page/maintainer-role "> maintainer</ a > :</ p >
453
469
< p > < a class ="reference external image-reference " href ="https://github.com/grindtildeath "> < img alt ="grindtildeath " src ="https://github.com/grindtildeath.png?size=40px " /> </ a > </ p >
454
- < p > This module is part of the < a class ="reference external " href ="https://github.com/OCA/web/tree/16 .0/web_datetime_picker_default_time "> OCA/web</ a > project on GitHub.</ p >
470
+ < p > This module is part of the < a class ="reference external " href ="https://github.com/OCA/web/tree/18 .0/web_datetime_picker_default_time "> OCA/web</ a > project on GitHub.</ p >
455
471
< p > You are welcome to contribute. To learn how please visit < a class ="reference external " href ="https://odoo-community.org/page/Contribute "> https://odoo-community.org/page/Contribute</ a > .</ p >
456
472
</ div >
457
473
</ div >
0 commit comments