Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
6436 Visualizzazioni

Hi.

I need to filter many2one field dropdown list to show me only current year entries. I can do this by domains in xml. It works good for current year but old entries are shown in the form as unknown now.

How can i solve this?

Avatar
Abbandona

Can you explain "but old entries are shown in the form as unknown now" a bit more?

If you put a domain (something like ('year', '>=', 2016)) in xml, old entries should not show up in the form.

Autore

i posted a pictures

Risposta migliore

Hi John Doe,

If XML is not giving exact result as you want then,

pass a context from that field and override "name_search" method of that class and return your data based on your requirement.

Avatar
Abbandona
Autore Risposta migliore

By this domain: <field name="timebox_id" widget="selection" options="{&quot;no_open&quot;: True}" string="Timeframe" domain="[('id','&gt;',40)]"/> it shows :

without domain:

I'd like to keep old timeframes and filter dropdown list only for this year

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
mag 25
4417
1
ott 22
4111
8
feb 17
8628
0
gen 17
6122
2
feb 24
12907