如何启用“键入"功能?在Odoo中的选择小部件上? [英] How to enable "typing" on selection widget in Odoo?

查看:147
本文介绍了如何启用“键入"功能?在Odoo中的选择小部件上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在程序中使用了选择小部件,并且下拉菜单中有很多项.有什么方法可以在上面键入内容,以便用户可以轻松地选择项目. (就像使JComboBox在Java中可编辑一样)

I have used a selection widget in my program and it has lot of items in the drop down. Is there any method to enable typing on it so user can select item easily. (just like making a JComboBox editable in java)

推荐答案

如果将many2one字段与widget="selection"一起使用,则可以通过单击选择框来选择它,然后开始键入要查找的内容,该框将更改为您正在写入的值.顺便说一句,您必须快速编写它,并且不能部署下拉列表.

If you are using the many2one field with the widget="selection", you can select the selection box by clicking it and you start typing what you are looking for, the box change to the value that you are writing. By the way, you must write it fast and the drop down must not be deployed.

另一个选择是使用many2one字段而不使用选择小部件.您可以安装社区模块 web_m2x_options 并使用limit属性避免选项搜索更多".这样,您可以在框中输入内容以查找元素.例如,在此示例中,您最多可以显示10个元素(不带搜索更多"选项):

The other option is to use a many2one field without the selection widget. You can install the community module web_m2x_options and use the limit attibute to avoid the option "Search More". Like this you can write in the box to find the elements. For example, you can show until 10 elements without the option "Search More" with this example:

<field name="example_id" options="{'create': False, 'create_edit': False, 'limit': 10}" />

这篇关于如何启用“键入"功能?在Odoo中的选择小部件上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆