Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2480 Weergaven

How do i search a date field in my odoo search by the year in that specific date field.

It should be able to search the date field by only comparing the year part in the date field.

Eg:- I have dates like '01/04/2015','04/07/2016','10/10/2015' . I want to fetch the date field by giving just 2016 and it should retrieve me the last two document alone. 

I tried following options but didn't work.

<field name="date" filter_domain="[('date.strftime('%%Y')','=',self)]"/>

<field name="date" filter_domain="[('date.strftime('%%Y')','=',time.strftime('%%Y'))]"/>

Avatar
Annuleer
Auteur

My Dates will be as follows 01/04/2015','04/07/2016','10/10/2016' and need to fetch last two records.

Gerelateerde posts Antwoorden Weergaven Activiteit
1
mei 18
8564
1
jul. 23
1816
1
feb. 22
1384
2
apr. 21
15339
5
okt. 16
12350