跳至内容
菜单
此问题已终结
2 回复
5063 查看

I have a html field in my form. When i try to edit my record this HTML field is automatically focused first.

Here is my code:

In .py file

description = fields.Html(string="Description")

and in xml file

<label for="description"/>
<field name="description" widget="html"/>

I have tried to remove the auto focus by the following:

<label for="description"/>
<field name="description" widget="html" tabindex="-1"/>
Still i didn't get any solution.
形象
丢弃

Did you add this field in the first position of the form ?

编写者

No. I have given in the middle.

and i have given takefocus=0 attribute in .py file, and its worked in my local. But when its in server its not working

I have tested the same in the odoo runbot, by adding a HTML field in the middle of the page and when clicking the edit button still the focus is on the first field

相关帖文 回复 查看 活动
0
2月 21
2642
3
5月 22
9164
0
4月 18
7693
0
7月 17
2861
0
3月 15
6426