[MIG] web_widget_datepicker_fulloptions: Migration to 16.0

This commit is contained in:
Quentin Dupont
2024-02-02 13:46:16 +01:00
parent c4c9d5dfcd
commit ab82cd7402
9 changed files with 41 additions and 57 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -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
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/14.0/web_widget_datepicker_fulloptions"><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-14-0/web-14-0-web_widget_datepicker_fulloptions"><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&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<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_widget_datepicker_fulloptions"><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_widget_datepicker_fulloptions"><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&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module enables full options in datepicker used in date fields :
- Choose todays date in one click
- Three buttons enabled : show today, clear field, close datepicker</p>
- Two buttons enabled : choosing today and closing datepicker with selected date</p>
<div class="figure">
<img alt="https://raw.githubusercontent.com/OCA/web/14.0/web_widget_datepicker_fulloptions/static/description/change.png" src="https://raw.githubusercontent.com/OCA/web/14.0/web_widget_datepicker_fulloptions/static/description/change.png" />
<img alt="https://raw.githubusercontent.com/OCA/web/16.0/web_widget_datepicker_fulloptions/static/description/change.png" src="https://raw.githubusercontent.com/OCA/web/16.0/web_widget_datepicker_fulloptions/static/description/change.png" />
</div>
<p>Clearing field doesnt work because there is a left todo in Odoo core code
here : <a class="reference external" href="https://github.com/odoo/odoo/blob/16.0/addons/web/static/lib/tempusdominus/tempusdominus.js#L1341">https://github.com/odoo/odoo/blob/16.0/addons/web/static/lib/tempusdominus/tempusdominus.js#L1341</a></p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
@@ -393,7 +395,7 @@ ul.auto-toc {
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_widget_datepicker_fulloptions%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_widget_datepicker_fulloptions%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
@@ -420,7 +422,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/14.0/web_widget_datepicker_fulloptions">OCA/web</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/16.0/web_widget_datepicker_fulloptions">OCA/web</a> project on GitHub.</p>
<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>
</div>
</div>

View File

@@ -0,0 +1,11 @@
/* @odoo-module */
import {DatePicker} from "@web/core/datepicker/datepicker";
Object.assign(DatePicker.defaultProps, {
buttons: {
showClear: true,
showClose: true,
showToday: true,
},
});

View File

@@ -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;
},
});
}
);