How to enable “typing” on selection widget in Odoo?

末鹿安然 提交于 2019-12-11 10:29:53

问题


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)


回答1:


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.

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}" />


来源:https://stackoverflow.com/questions/32310071/how-to-enable-typing-on-selection-widget-in-odoo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!