diff --git a/web_widget_datepicker_fulloptions/README.rst b/web_widget_datepicker_fulloptions/README.rst
index e62a0dc52..6c079a274 100644
--- a/web_widget_datepicker_fulloptions/README.rst
+++ b/web_widget_datepicker_fulloptions/README.rst
@@ -7,7 +7,7 @@ Web Widget DatePicker Full Options
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:3c167f165dee6be58d095c8341832721bc688418cb356dfbb644665fd8ed6a90
+ !! source digest: sha256:5cc5388c1796a804d92121313d4d48a9080f3173acf9dbafe6b2da73f9ae2241
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -17,22 +17,25 @@ Web Widget DatePicker Full Options
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
- :target: https://github.com/OCA/web/tree/14.0/web_widget_datepicker_fulloptions
+ :target: https://github.com/OCA/web/tree/16.0/web_widget_datepicker_fulloptions
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/web-14-0/web-14-0-web_widget_datepicker_fulloptions
+ :target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_widget_datepicker_fulloptions
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
- :target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=14.0
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
This module enables full options in datepicker used in date fields :
- Choose today's date in one click
-- Three buttons enabled : show today, clear field, close datepicker
+- Two buttons enabled : choosing today and closing datepicker with selected date
-.. figure:: https://raw.githubusercontent.com/OCA/web/14.0/web_widget_datepicker_fulloptions/static/description/change.png
+.. figure:: https://raw.githubusercontent.com/OCA/web/16.0/web_widget_datepicker_fulloptions/static/description/change.png
+
+Clearing field doesn't work because there is a left 'todo' in Odoo core code
+here : https://github.com/odoo/odoo/blob/16.0/addons/web/static/lib/tempusdominus/tempusdominus.js#L1341
**Table of contents**
@@ -45,7 +48,7 @@ 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 `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -77,6 +80,6 @@ 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.
-This module is part of the `OCA/web `_ project on GitHub.
+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.
diff --git a/web_widget_datepicker_fulloptions/__manifest__.py b/web_widget_datepicker_fulloptions/__manifest__.py
index 751299d2b..013d12c2c 100644
--- a/web_widget_datepicker_fulloptions/__manifest__.py
+++ b/web_widget_datepicker_fulloptions/__manifest__.py
@@ -2,7 +2,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Web Widget DatePicker Full Options",
- "version": "14.0.1.0.0",
+ "version": "16.0.1.0.0",
"author": "GRAP, " "Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Web",
@@ -11,7 +11,10 @@
"depends": [
"web",
],
- "data": [
- "views/web_widget_datepicker_fulloptions_assets.xml",
- ],
+ "assets": {
+ "web.assets_backend": [
+ "web_widget_datepicker_fulloptions/static/src/js/"
+ "web_widget_datepicker_fulloptions.esm.js"
+ ],
+ },
}
diff --git a/web_widget_datepicker_fulloptions/readme/DESCRIPTION.rst b/web_widget_datepicker_fulloptions/readme/DESCRIPTION.rst
index a0b41ca17..eb5d55129 100644
--- a/web_widget_datepicker_fulloptions/readme/DESCRIPTION.rst
+++ b/web_widget_datepicker_fulloptions/readme/DESCRIPTION.rst
@@ -1,5 +1,8 @@
This module enables full options in datepicker used in date fields :
- Choose today's date in one click
-- Three buttons enabled : show today, clear field, close datepicker
+- Two buttons enabled : choosing today and closing datepicker with selected date
.. figure:: ../static/description/change.png
+
+Clearing field doesn't work because there is a left 'todo' in Odoo core code
+here : https://github.com/odoo/odoo/blob/16.0/addons/web/static/lib/tempusdominus/tempusdominus.js#L1341
diff --git a/web_widget_datepicker_fulloptions/static/description/change.png b/web_widget_datepicker_fulloptions/static/description/change.png
index 3d46cc8ea..f12696272 100644
Binary files a/web_widget_datepicker_fulloptions/static/description/change.png and b/web_widget_datepicker_fulloptions/static/description/change.png differ
diff --git a/web_widget_datepicker_fulloptions/static/description/icon.png b/web_widget_datepicker_fulloptions/static/description/icon.png
index d36d16c94..1807ff86b 100644
Binary files a/web_widget_datepicker_fulloptions/static/description/icon.png and b/web_widget_datepicker_fulloptions/static/description/icon.png differ
diff --git a/web_widget_datepicker_fulloptions/static/description/index.html b/web_widget_datepicker_fulloptions/static/description/index.html
index dae98d1b2..96697d510 100644
--- a/web_widget_datepicker_fulloptions/static/description/index.html
+++ b/web_widget_datepicker_fulloptions/static/description/index.html
@@ -367,15 +367,17 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! source digest: sha256:3c167f165dee6be58d095c8341832721bc688418cb356dfbb644665fd8ed6a90
+!! source digest: sha256:5cc5388c1796a804d92121313d4d48a9080f3173acf9dbafe6b2da73f9ae2241
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This module enables full options in datepicker used in date fields :
- Choose today’s date in one click
-- Three buttons enabled : show today, clear field, close datepicker
+- Two buttons enabled : choosing today and closing datepicker with selected date
+Clearing field doesn’t work because there is a left ‘todo’ in Odoo core code
+here : https://github.com/odoo/odoo/blob/16.0/addons/web/static/lib/tempusdominus/tempusdominus.js#L1341
Table of contents
@@ -393,7 +395,7 @@ ul.auto-toc {
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.
+feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -420,7 +422,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
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.
-
This module is part of the OCA/web project on GitHub.
+
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.
diff --git a/web_widget_datepicker_fulloptions/static/src/js/web_widget_datepicker_fulloptions.esm.js b/web_widget_datepicker_fulloptions/static/src/js/web_widget_datepicker_fulloptions.esm.js
new file mode 100644
index 000000000..6b67a15c9
--- /dev/null
+++ b/web_widget_datepicker_fulloptions/static/src/js/web_widget_datepicker_fulloptions.esm.js
@@ -0,0 +1,11 @@
+/* @odoo-module */
+
+import {DatePicker} from "@web/core/datepicker/datepicker";
+
+Object.assign(DatePicker.defaultProps, {
+ buttons: {
+ showClear: true,
+ showClose: true,
+ showToday: true,
+ },
+});
diff --git a/web_widget_datepicker_fulloptions/static/src/js/web_widget_datepicker_fulloptions.js b/web_widget_datepicker_fulloptions/static/src/js/web_widget_datepicker_fulloptions.js
deleted file mode 100644
index d79ebb413..000000000
--- a/web_widget_datepicker_fulloptions/static/src/js/web_widget_datepicker_fulloptions.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright 2021 Quentin DUPONT
- * License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). */
-odoo.define(
- "web_widget_datepicker_fulloptions.datepicker_fulloptions",
- function (require) {
- "use strict";
-
- var DatePicker = require("web.datepicker");
-
- DatePicker.DateWidget.include({
- /**
- * @override
- */
- init: function (parent, options) {
- this._super(parent, options);
- this.options.useCurrent = true;
- this.options.buttons.showToday = true;
- this.options.buttons.showClear = true;
- this.options.buttons.showClose = true;
- },
- });
- }
-);
diff --git a/web_widget_datepicker_fulloptions/views/web_widget_datepicker_fulloptions_assets.xml b/web_widget_datepicker_fulloptions/views/web_widget_datepicker_fulloptions_assets.xml
deleted file mode 100644
index a442d5504..000000000
--- a/web_widget_datepicker_fulloptions/views/web_widget_datepicker_fulloptions_assets.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-