İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
6981 Görünümler

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
Vazgeç

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.

En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Mar 23
3898
0
Şub 23
1615
0
Tem 24
712
0
Şub 23
439
1
Ağu 22
4580