Hi i have a custom form like purchase order, it have a header and line, here the line opens like a form. I want to focus a field whenever the line form open. Is there any way to focus a field?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
To automatically focus on a specific field in Odoo, you can use the autofocus attribute in the field definition. For example:
Copy codename="field_name" autofocus="autofocus"/>
This will cause the field to automatically receive focus when the form is displayed.
Alternatively, you can use JavaScript to set the focus on a field. To do this, you can use the focus() function on the field element. For example:document.getElementById('field_id').focus();
You can also use the widget attribute to specify a custom widget that includes the autofocus attribute. For example:
name="field_name" widget="my_widget"/> id="view_id_form_view" model="ir.ui.view"> name="name">view.name.form name="model">model.name name="arch" type="xml"> string="My Form"> name="field_name" widget="my_widget"/> id="my_widget" model="ir.ui.view"> name="name">my.widget name="model">model.name name="arch" type="xml"> string="My Widget" autofocus="autofocus"> name="field_name"/>
I hope this helps! Let me know if you have any questions or need further assistance
Thanks for the Reply. Muhammad Imran,
I tried this but didn't fulfil my requirements.
If you know any other solution please provide.
Thanks.
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
0
mar 24
|
871 | ||
|
2
wrz 23
|
1723 | ||
|
1
gru 23
|
3734 | ||
|
2
cze 23
|
2020 | ||
|
1
maj 23
|
1993 |