Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
6957 Näkymät

Hello,

I have a notebook with week days as pages. When I open the module which contains the notebook, I want to have the auto focus on the page associated with the current week day. (  If it's Thursday, I want to see the Thursday page ).

Any ideas on how can I do this ?

I'm  working with Odoo 11 CE.


Thank you!

Avatar
Hylkää

you can add autofocus="autofocus" to auto focus any page or field. I think you can not do based on conditionally using XML, you need to create JS stuff to do this.

Paras vastaus

Hello,

you can try fields_view_get method for it. Where you can set node for page like below code.

for node in document.xpath ("// page [@name = '% s']"% now.strftime ("% a")):
    node.set ("autofocus", "autofocus")

may be this will help you.

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
maalisk. 23
3860
0
helmik. 23
1602
0
heinäk. 24
710
0
helmik. 23
439
1
elok. 22
4558