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.
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
| 関連投稿 | 返信 | ビュー | 活動 | |
|---|---|---|---|---|
|
2
5月 25
|
5934 | |||
|
1
10月 22
|
5522 | |||
|
8
2月 17
|
10232 | |||
|
0
1月 17
|
7266 | |||
|
2
2月 24
|
14423 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.
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