Hi
odoo11
how get date from datetime field in domain of search view? (for compare with current_date)
how set " datetime_field" in below:
<filter name="today" string="Today" domain="[('datetime_field','=',current_date]"/>
Thanks
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi
odoo11
how get date from datetime field in domain of search view? (for compare with current_date)
how set " datetime_field" in below:
<filter name="today" string="Today" domain="[('datetime_field','=',current_date]"/>
Thanks
Hi,
You can use the below:
<filter string="Today" domain="[('datetime_field', '>=', datetime.datetime.combine(context_today(), datetime.time(0,0,0))),
('datetimefield', '<=', datetime.datetime.combine(context_today(), datetime.time(23,59,59)))]" />
Excellent
thanks so much for your help :)
You can use this if you want to filter Datetime field just by date:
<field name="min_date" widget="date" filter_domain="[('min_date','>=',self+' 00:00:00'),('min_date','<=',self+' 23:59:59')]"/>
Create an account today to enjoy exclusive features and engage with our awesome community!
Üye Olİlgili Gönderiler | Cevaplar | Görünümler | Aktivite | |
---|---|---|---|---|
|
1
Oca 20
|
10804 | ||
|
1
Ara 20
|
21048 | ||
search view date datetime
Çözüldü
|
|
3
Oca 19
|
8156 | |
Search within a period of date
Çözüldü
|
|
22
Ara 23
|
49227 | |
|
0
Nis 18
|
5463 |