This question has been flagged
1 Reply
11313 Views

Hello Forum,

How to direct a Cursor to a specific field when user opens and edits a form of picking list e.g.??

The employees need to open a picking list and press edit it, then they type the number of packaged delivered. But when they start typing using the keyboard, the cursor is situated in first field (partner field) and I would like cursor situated directly in a specific field. Is it possible to do it? I mean to change the location of curson when you open and edit a form. Thank you.

Avatar
Discard
Best Answer

You need to change the view definition and add an attribute default_focus: set to 1 to put the focus (cursor position) on this field when the form is first opened. There can only be one field within a view having this attribute set to 1.

Example:

<field name="name" default_focus=”1”/>


Avatar
Discard
Author

Thanks a lot Odoo Master :)

@Zbik I would like to add default_focus inside the field in tree editable="bottom". But it not working, How to apply default_focus in tree editable="bottom"? Thanks

I have try this code for wizard char field but it is not working for me, Can you please give me solution for this?

Hello @Zbik, I have facing same problem as @prakash. For wizard char field it is not working for me. Can you provide solution for this problem?

FYI, I opened a bug report about the problem with default_focus not working in wizards https://github.com/odoo/odoo/issues/29589