Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
6198 Widoki

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?

Awatar
Odrzuć

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.

Autor

i posted a pictures

Najlepsza odpowiedź

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.

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
maj 25
4159
1
paź 22
3859
8
lut 17
8401
0
sty 17
5918
2
lut 24
12608