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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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?
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.
By this domain: <field name="timebox_id" widget="selection" options="{"no_open": True}" string="Timeframe" domain="[('id','>',40)]"/> it shows :
without domain:
I'd like to keep old timeframes and filter dropdown list only for this year
Create an account today to enjoy exclusive features and engage with our awesome community!
Registrar-seRelated Posts | Respostes | Vistes | Activitat | |
---|---|---|---|---|
|
2
de maig 25
|
4014 | ||
Domain with inherited field
Solved
|
|
1
d’oct. 22
|
3753 | |
|
8
de febr. 17
|
8258 | ||
|
0
de gen. 17
|
5840 | ||
|
2
de febr. 24
|
12491 |
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.
i posted a pictures