mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[ADD] Web widget Datepicker full options
This commit is contained in:
committed by
Alessandro Uffreduzzi
parent
32a028e2fe
commit
0eac931f70
1
web_widget_datepicker_fulloptions/__init__.py
Normal file
1
web_widget_datepicker_fulloptions/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
18
web_widget_datepicker_fulloptions/__manifest__.py
Normal file
18
web_widget_datepicker_fulloptions/__manifest__.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Copyright 2021 Quentin DUPONT
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
{
|
||||
"name": "Web Widget DatePicker Full Options",
|
||||
"version": "12.0.1.0.0",
|
||||
"author": "GRAP, "
|
||||
"Odoo Community Association (OCA)",
|
||||
"license": "AGPL-3",
|
||||
"category": "Web",
|
||||
"website": "https://github.com/OCA/web/",
|
||||
'installable': True,
|
||||
"depends": [
|
||||
"web",
|
||||
],
|
||||
"data": [
|
||||
"views/web_widget_datepicker_fulloptions_assets.xml",
|
||||
],
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
* `GRAP <http://www.grap.coop>`_:
|
||||
|
||||
* Quentin DUPONT <quentin.dupont@grap.coop>
|
||||
5
web_widget_datepicker_fulloptions/readme/DESCRIPTION.rst
Normal file
5
web_widget_datepicker_fulloptions/readme/DESCRIPTION.rst
Normal file
@@ -0,0 +1,5 @@
|
||||
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
|
||||
|
||||
.. figure:: ../static/description/change.png
|
||||
BIN
web_widget_datepicker_fulloptions/static/description/change.png
Normal file
BIN
web_widget_datepicker_fulloptions/static/description/change.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
BIN
web_widget_datepicker_fulloptions/static/description/icon.png
Normal file
BIN
web_widget_datepicker_fulloptions/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
@@ -0,0 +1,21 @@
|
||||
/* 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');
|
||||
|
||||
var DatePickerFullOptions = 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;
|
||||
},
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<odoo>
|
||||
<template id="web_widget_datepicker_fulloptions_assets_backend"
|
||||
name="web_widget_datepicker_fulloptions_assets"
|
||||
inherit_id="web.assets_backend">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript"
|
||||
src="/web_widget_datepicker_fulloptions/static/src/js/web_widget_datepicker_fulloptions.js"/>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user