问题
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