odoo 输入框 禁止自动填充

https://zhuanlan.zhihu.com/p/387878201

ODOO的日期输入框在选择日期的时候会自动带出浏览器的历史记录,而这个历史记录意义不大,很影响选择日期,用户体验感非常不好,那么如何解决呢?

下面就给出了解决方案:

使用继承的

<?xml version="1.0" encoding="utf-8"?>
<templates t-name="form_datepicker_no_autocomplete">
    <t t-extend="web.datepicker">
        <!-- 给时间输入框加 autocomplete=off ,取消自动弹出浏览器的历史输入记录 -->
        <t t-jquery="input.o_datepicker_input" t-operation="replace">
            <input type="text" class="o_datepicker_input" t-att-name="widget.name" t-att-placeholder="placeholder" autocomplete="off" />
        </t>
    </t>
</templates>

 

方式修改日期输入框的模板,增加autocomplete=“off”,然后在manifest文件中加载这个qweb模板,实际模块即可解决.

 

posted on 2022-11-12 10:05  Odoo在中国  阅读(52)  评论(0编辑  收藏  举报

导航