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
 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.

<?xml version="1.0" encoding="utf-8"?>
<templates id="template" xml:space="preserve">
    <t t-extend="web.datepicker">
        <t t-jquery="input.o_datepicker_input" t-operation="replace">
            <input type="text" class="o_datepicker_input o_input datetimepicker-input" 
                t-att-name="widget.name" 
                t-att-placeholder="placeholder" 
                t-attf-data-target="##{datepickerID}" 
                autocomplete="off" />
        </t>
    </t>
</templates>

STEP 2:  __manifest__.py
 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.

‘qweb’ : [
“static/src/xml/{FILENAME}.xml”,
]

STEP 3:  Server Restart

If you like to know more about our discounted Odoo pricing and get a free Odoo demo online, get in touch with our Odoo Support and Maintenance Team.

If you like us to help you with your next odoo customisation project please contact us now

Talk to our experts now

    Talk To Our Experts Now