diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index f6d20e2b617..3accd712a57 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -896,6 +896,10 @@ label.error { } .openerp .oe_datepicker { position: relative; + display: inline-block; +} +.openerp .oe_datepicker input[type="text"] { + min-width: 160px; } .openerp .oe_input_icon_disabled { position: absolute; diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index a26d87636d8..a2151dbd40f 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -803,9 +803,6 @@ openerp.web.search.DateField = openerp.web.search.Field.extend(/** @lends opener this.attrs.default_focus === '1' ? 'autofocus' : undefined); this.datewidget.set_value(this.defaults[this.attrs.name] || false); }, - stop: function () { - this.$element.datepicker('destroy'); - }, get_value: function () { return this.datewidget.get_value() || null; } @@ -1122,7 +1119,7 @@ openerp.web.search.ExtendedSearchProposition.Char = openerp.web.OldWidget.extend } }); openerp.web.search.ExtendedSearchProposition.DateTime = openerp.web.OldWidget.extend({ - template: 'SearchView.extended_search.proposition.datetime', + template: 'SearchView.extended_search.proposition.empty', identifier_prefix: 'extended-search-proposition-datetime', operators: [ {value: "=", text: "is equal to"}, @@ -1133,18 +1130,16 @@ openerp.web.search.ExtendedSearchProposition.DateTime = openerp.web.OldWidget.ex {value: "<=", text: "less or equal than"} ], get_value: function() { - return this.$element.val(); + return this.datewidget.get_value(); }, start: function() { this._super(); - this.$element.datetimepicker({ - dateFormat: 'yy-mm-dd', - timeFormat: 'hh:mm:ss' - }); + this.datewidget = new openerp.web.DateTimeWidget(this); + this.datewidget.prependTo(this.$element); } }); openerp.web.search.ExtendedSearchProposition.Date = openerp.web.OldWidget.extend({ - template: 'SearchView.extended_search.proposition.date', + template: 'SearchView.extended_search.proposition.empty', identifier_prefix: 'extended-search-proposition-date', operators: [ {value: "=", text: "is equal to"}, @@ -1155,14 +1150,12 @@ openerp.web.search.ExtendedSearchProposition.Date = openerp.web.OldWidget.extend {value: "<=", text: "less or equal than"} ], get_value: function() { - return this.$element.val(); + return this.datewidget.get_value(); }, start: function() { this._super(); - this.$element.datepicker({ - dateFormat: 'yy-mm-dd', - timeFormat: 'hh:mm:ss' - }); + this.datewidget = new openerp.web.DateWidget(this); + this.datewidget.prependTo(this.$element); } }); openerp.web.search.ExtendedSearchProposition.Integer = openerp.web.OldWidget.extend({ diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index afec46fe6ad..346e6653018 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1156,11 +1156,8 @@ - - - - - + +