Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2558 มุมมอง

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'))]"/>

อวตาร
ละทิ้ง
ผู้เขียน

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ค. 18
8613
1
ก.ค. 23
1857
1
ก.พ. 22
1434
2
เม.ย. 21
15398
inherit search view in openerp7 แก้ไขแล้ว
5
ต.ค. 16
12396