Trợ giúp


[Odoo 14 CE] Put autofocus on a certain page of a notebook


Dear all,

I'm struggling with the abovementioend topic since yesterday. Although I found several hints in this forum as well as other froum I still got no solution.

I would like to put the focus on a specific page of a notebook according to a certain stage of a process. Of course it works with the "autofous"-parameter inside the XML-descirption of the view. But then always the same page will be "autofocussed". Did I oversee something in the documentation which allows passing an bool expression for the "autofocus"-parameter?

I also tried to control the autofocus for a page from within the Python-file of the model - like this:

        doc = etree.XML(res['arch'])
        ann_field = doc.xpath("//page[@name='inspection']")
        if ann_field:
        res['arch'] = etree.tostring(doc)
        return res

Unfortunately this didn't work for setting the autofocus parameter of a page. Obviously, the set-method is never reached because the preceding doc.xpath()-call does not provide the reference to the widget...

I tried to set the text of a label by using this method and it worked well. After playing around for a while trying other things I don't have any further idea of how to solve the problem. Can somebody of you give me an advice?

Any help is greatly approciated.

Many thanks in advance and greeting from Northern Germany!


Ảnh đại diện
Huỷ bỏ