{"id":1024,"date":"2020-07-18T05:54:50","date_gmt":"2020-07-18T05:54:50","guid":{"rendered":"https:\/\/www.confianzit.com\/cit-blog\/?p=1024"},"modified":"2022-10-31T17:53:28","modified_gmt":"2022-10-31T17:53:28","slug":"auto-completion-of-date-widget","status":"publish","type":"post","link":"https:\/\/www.confianzit.com\/cit-blog\/auto-completion-of-date-widget\/","title":{"rendered":"Auto Completion of Date Widget in Odoo"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;4.9.4&#8243; hover_enabled=&#8221;0&#8243; module_class=&#8221;blog-left-content&#8221; sticky_enabled=&#8221;0&#8243;][et_pb_row _builder_version=&#8221;4.9.4&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; hover_enabled=&#8221;0&#8243; column_structure=&#8221;3_5,2_5&#8243; sticky_enabled=&#8221;0&#8243;][et_pb_column type=&#8221;3_5&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_text _builder_version=&#8221;3.27.4&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;]<!-- divi:paragraph --><\/p>\n<p>In <a href=\"https:\/\/www.confianzit.com\/odoo-erp\" class=\"rank-math-link\">Odoo<\/a>, when we click on a date widget a calendar is rendered and along with that recently used dates are also rendered. Because of this, there will be difficulty in choosing a new date from the calendar that rendered.<\/p>\n<p><!-- \/divi:paragraph --><\/p>\n<p><!-- divi:paragraph --><\/p>\n<p>We can fix this issue by using the below code.<\/p>\n<p><!-- \/divi:paragraph --><\/p>\n<p><!-- divi:paragraph --><\/p>\n<p><strong>Getting started<\/strong><\/p>\n<p><!-- \/divi:paragraph --><\/p>\n<p><!-- divi:paragraph {\"align\":\"center\"} --><\/p>\n<p class=\"has-text-align-center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/VMJ2FS3_ZJ1mrH-lqtF3bTaOgHrpdA_nVL36Sd8YFYPSzA9vgEn63zrfsYWdb5aaNrPx57U-o3_15iM7kmwFIZxgNkcFPYSx7NaL-Eellmal_Zgh4zIxgFE7jGaROLuaBHifIaM2\" width=\"541\" height=\"532\"><\/p>\n<p><!-- \/divi:paragraph --><\/p>\n<p><!-- divi:code --><\/p>\n<pre class=\"wp-block-code\"><code>STEP 1:  \/static\/src\/xml\/{FILENAME}.xml\n At first, inherit the date widget template and then add autocompletion as an argument, then set it as off. This will turn off the autocompletion.\n\n&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;templates id=\"template\" xml:space=\"preserve\"&gt;\n    &lt;t t-extend=\"web.datepicker\"&gt;\n        &lt;t t-jquery=\"input.o_datepicker_input\" t-operation=\"replace\"&gt;\n            &lt;input type=\"text\" class=\"o_datepicker_input o_input datetimepicker-input\" \n                t-att-name=\"widget.name\" \n                t-att-placeholder=\"placeholder\" \n                t-attf-data-target=\"##{datepickerID}\" \n                autocomplete=\"off\" \/&gt;\n        &lt;\/t&gt;\n    &lt;\/t&gt;\n&lt;\/templates&gt;\n<\/code><\/pre>\n<p><!-- \/divi:code --><\/p>\n<p><!-- divi:code --><\/p>\n<pre class=\"wp-block-code\"><code>STEP 2:  __manifest__.py\n Normally, all widgets are loaded by a JS file. Here we also need to load the widget. Add the file in qweb (in manifest file) then we can see the changes made.\n\n\u2018qweb\u2019 : &#091;\n\u201cstatic\/src\/xml\/{FILENAME}.xml\u201d,\n]\n<\/code><\/pre>\n<p><!-- \/divi:code --><\/p>\n<p><!-- divi:code --><\/p>\n<pre class=\"wp-block-code\"><code>STEP 3:  Server Restart<\/code><\/pre>\n<p><!-- \/divi:code --><\/p>\n<p><!-- divi:paragraph --><\/p>\n<p>If you like to know more about our discounted <a href=\"https:\/\/www.confianzit.com\/odoo\/pricing\">Odoo pricing<\/a> and get a free <a href=\"https:\/\/www.confianzit.com\/odoo-demo\">Odoo demo<\/a> online, get in touch with our <a href=\"https:\/\/www.confianzit.com\/odoo-support-maintenance\">Odoo Support and Maintenance<\/a> Team.<\/p>\n<p><!-- \/divi:paragraph --><\/p>\n<p><!-- divi:paragraph --><\/p>\n<p>If you like us to help you with your next<a href=\"https:\/\/www.confianzit.com\/openerp-customization\" class=\"rank-math-link\"> odoo customisation<\/a> project please contact us now<\/p>\n<p><!-- \/divi:paragraph -->[\/et_pb_text][\/et_pb_column][et_pb_column type=&#8221;2_5&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_code _builder_version=&#8221;4.9.4&#8243; _module_preset=&#8221;default&#8221; locked=&#8221;off&#8221; global_module=&#8221;2151&#8243;]<\/p>\n<div class=\"blog-floating-form\"><!-- [et_pb_line_break_holder] -->  <\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_62 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.confianzit.com\/cit-blog\/auto-completion-of-date-widget\/#Talk_to_our_experts_now\" title=\"    Talk to our experts now  \">    Talk to our experts now  <\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.confianzit.com\/cit-blog\/auto-completion-of-date-widget\/#Talk_To_Our_Experts_Now\" title=\"Talk To Our Experts Now\n\t\">Talk To Our Experts Now\n\t<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"Talk_to_our_experts_now\"><\/span><!-- [et_pb_line_break_holder] -->    Talk to our experts now<!-- [et_pb_line_break_holder] -->  <span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p><!-- [et_pb_line_break_holder] -->  \n<div class=\"wpcf7 no-js\" id=\"wpcf7-f1888-o1\" lang=\"en-US\" dir=\"ltr\">\n<div class=\"screen-reader-response\"><p role=\"status\" aria-live=\"polite\" aria-atomic=\"true\"><\/p> <ul><\/ul><\/div>\n<form action=\"\/cit-blog\/wp-json\/wp\/v2\/posts\/1024#wpcf7-f1888-o1\" method=\"post\" class=\"wpcf7-form init\" aria-label=\"Contact form\" novalidate=\"novalidate\" data-status=\"init\">\n<div style=\"display: none;\">\n<input type=\"hidden\" name=\"_wpcf7\" value=\"1888\" \/>\n<input type=\"hidden\" name=\"_wpcf7_version\" value=\"5.8.6\" \/>\n<input type=\"hidden\" name=\"_wpcf7_locale\" value=\"en_US\" \/>\n<input type=\"hidden\" name=\"_wpcf7_unit_tag\" value=\"wpcf7-f1888-o1\" \/>\n<input type=\"hidden\" name=\"_wpcf7_container_post\" value=\"0\" \/>\n<input type=\"hidden\" name=\"_wpcf7_posted_data_hash\" value=\"\" \/>\n<input type=\"hidden\" name=\"_wpcf7_recaptcha_response\" value=\"\" \/>\n<\/div>\n<div class=\"form-block\" style=\"    background: #fff;\">\n\t<h3 style=\"    background: #0C2464;\n    border-bottom: 5px solid #cecece;\n    border-radius: 5px 5px 90px 90px;\n    margin: 0 auto;\n    text-align: center;\n    padding: 20px;\n    color: #fff;    margin-bottom: 15px;\"><span class=\"ez-toc-section\" id=\"Talk_To_Our_Experts_Now\"><\/span><b>Talk To Our Experts Now<\/b>\n\t<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\t<div style=\"padding:20px;\">\n\t\t<p><span class=\"wpcf7-form-control-wrap\" data-name=\"your-name\"><input size=\"40\" class=\"wpcf7-form-control wpcf7-text wpcf7-validates-as-required your-name\" aria-required=\"true\" aria-invalid=\"false\" placeholder=\"Name\" value=\"\" type=\"text\" name=\"your-name\" \/><\/span>\n\t\t<\/p>\n\t\t<p><span class=\"wpcf7-form-control-wrap\" data-name=\"your-email\"><input size=\"40\" class=\"wpcf7-form-control wpcf7-email wpcf7-validates-as-required wpcf7-text wpcf7-validates-as-email your-email\" aria-required=\"true\" aria-invalid=\"false\" placeholder=\"Email\" value=\"\" type=\"email\" name=\"your-email\" \/><\/span>\n\t\t<\/p>\n\t\t<p><span class=\"wpcf7-form-control-wrap\" data-name=\"your-number\"><input size=\"40\" class=\"wpcf7-form-control wpcf7-tel wpcf7-validates-as-required wpcf7-text wpcf7-validates-as-tel your-number\" aria-required=\"true\" aria-invalid=\"false\" placeholder=\"Phone Number\" value=\"\" type=\"tel\" name=\"your-number\" \/><\/span>\n\t\t<\/p>\n\t\t<p><span class=\"wpcf7-form-control-wrap\" data-name=\"message\"><textarea cols=\"40\" rows=\"10\" class=\"wpcf7-form-control wpcf7-textarea wpcf7-validates-as-required form-message\" aria-required=\"true\" aria-invalid=\"false\" placeholder=\"Message\" name=\"message\"><\/textarea><\/span>\n\t\t<\/p>\n\t<span class=\"wpcf7-form-control-wrap recaptcha\" data-name=\"recaptcha\"><span data-sitekey=\"6LfFkQATAAAAAIYlZ_UH9UozO-OLkpAaWPWx6QtM\" class=\"wpcf7-form-control wpcf7-recaptcha g-recaptcha\"><\/span>\r\n<noscript>\r\n\t<div class=\"grecaptcha-noscript\">\r\n\t\t<iframe loading=\"lazy\" src=\"https:\/\/www.google.com\/recaptcha\/api\/fallback?k=6LfFkQATAAAAAIYlZ_UH9UozO-OLkpAaWPWx6QtM\" frameborder=\"0\" scrolling=\"no\" width=\"310\" height=\"430\">\r\n\t\t<\/iframe>\r\n\t\t<textarea name=\"g-recaptcha-response\" rows=\"3\" cols=\"40\" placeholder=\"reCaptcha Response Here\">\r\n\t\t<\/textarea>\r\n\t<\/div>\r\n<\/noscript>\r\n<\/span>\n\t\t<div class=\"form-buttons\">\n\t\t\t<p><input class=\"wpcf7-form-control wpcf7-submit has-spinner\" type=\"submit\" value=\"Get a free quote\" \/>\n\t\t\t<\/p>\n\t\t<\/div>\n\t<\/div>\n<\/div><div class=\"wpcf7-response-output\" aria-hidden=\"true\"><\/div>\n<\/form>\n<\/div>\n<!-- [et_pb_line_break_holder] --><\/div>\n<p>[\/et_pb_code][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Odoo, when we click on a date widget a calendar is rendered and along with that recently used dates are also rendered. Because of this, there will be difficulty in choosing a new date from the calendar that rendered. We can fix this issue by using the below code. Getting started STEP 1: \/static\/src\/xml\/{FILENAME}.xml [&hellip;]<\/p>\n","protected":false},"author":17,"featured_media":1123,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"<!-- wp:paragraph -->\n<p>In <a href=\"https:\/\/www.confianzit.com\/odoo-erp\" class=\"rank-math-link\">Odoo<\/a>, when we click on a date widget a calendar is rendered and along with that recently used dates are also rendered. Because of this, there will be difficulty in choosing a new date from the calendar that rendered.<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>We can fix this issue by using the below code.<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p><strong>Getting started<\/strong><\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph {\"align\":\"center\"} -->\n<p class=\"has-text-align-center\"><img src=\"https:\/\/lh6.googleusercontent.com\/VMJ2FS3_ZJ1mrH-lqtF3bTaOgHrpdA_nVL36Sd8YFYPSzA9vgEn63zrfsYWdb5aaNrPx57U-o3_15iM7kmwFIZxgNkcFPYSx7NaL-Eellmal_Zgh4zIxgFE7jGaROLuaBHifIaM2\" width=\"541\" height=\"532\"><\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:code -->\n<pre class=\"wp-block-code\"><code>STEP 1:  \/static\/src\/xml\/{FILENAME}.xml\n At first, inherit the date widget template and then add autocompletion as an argument, then set it as off. This will turn off the autocompletion.\n\n&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;templates id=\"template\" xml:space=\"preserve\"&gt;\n    &lt;t t-extend=\"web.datepicker\"&gt;\n        &lt;t t-jquery=\"input.o_datepicker_input\" t-operation=\"replace\"&gt;\n            &lt;input type=\"text\" class=\"o_datepicker_input o_input datetimepicker-input\" \n                t-att-name=\"widget.name\" \n                t-att-placeholder=\"placeholder\" \n                t-attf-data-target=\"##{datepickerID}\" \n                autocomplete=\"off\" \/&gt;\n        &lt;\/t&gt;\n    &lt;\/t&gt;\n&lt;\/templates&gt;\n<\/code><\/pre>\n<!-- \/wp:code -->\n\n<!-- wp:code -->\n<pre class=\"wp-block-code\"><code>STEP 2:  __manifest__.py\n Normally, all widgets are loaded by a JS file. Here we also need to load the widget. Add the file in qweb (in manifest file) then we can see the changes made.\n\n\u2018qweb\u2019 : &#91;\n\u201cstatic\/src\/xml\/{FILENAME}.xml\u201d,\n]\n<\/code><\/pre>\n<!-- \/wp:code -->\n\n<!-- wp:code -->\n<pre class=\"wp-block-code\"><code>STEP 3:  Server Restart<\/code><\/pre>\n<!-- \/wp:code -->\n\n<!-- wp:paragraph -->\n<p>If you like to know more about our discounted <a href=\"https:\/\/www.confianzit.com\/odoo\/pricing\">Odoo pricing<\/a> and get a free <a href=\"https:\/\/www.confianzit.com\/odoo-demo\">Odoo demo<\/a> online, get in touch with our <a href=\"https:\/\/www.confianzit.com\/odoo-support-maintenance\">Odoo Support and Maintenance<\/a> Team.<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>If you like us to help you with your next<a href=\"https:\/\/www.confianzit.com\/openerp-customization\" class=\"rank-math-link\"> odoo customisation<\/a> project please contact us now<\/p>\n<!-- \/wp:paragraph -->","_et_gb_content_width":"","footnotes":""},"categories":[143],"tags":[61,91,172,171],"_links":{"self":[{"href":"https:\/\/www.confianzit.com\/cit-blog\/wp-json\/wp\/v2\/posts\/1024"}],"collection":[{"href":"https:\/\/www.confianzit.com\/cit-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.confianzit.com\/cit-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.confianzit.com\/cit-blog\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/www.confianzit.com\/cit-blog\/wp-json\/wp\/v2\/comments?post=1024"}],"version-history":[{"count":8,"href":"https:\/\/www.confianzit.com\/cit-blog\/wp-json\/wp\/v2\/posts\/1024\/revisions"}],"predecessor-version":[{"id":27262,"href":"https:\/\/www.confianzit.com\/cit-blog\/wp-json\/wp\/v2\/posts\/1024\/revisions\/27262"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.confianzit.com\/cit-blog\/wp-json\/wp\/v2\/media\/1123"}],"wp:attachment":[{"href":"https:\/\/www.confianzit.com\/cit-blog\/wp-json\/wp\/v2\/media?parent=1024"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.confianzit.com\/cit-blog\/wp-json\/wp\/v2\/categories?post=1024"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.confianzit.com\/cit-blog\/wp-json\/wp\/v2\/tags?post=1024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}