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

Hello,

I am using Odoo 10 and I am trying to perform a search within a date range. In terms of usability what I would like to achieve is the following:

- The user types a date on the search bar and a dropdown menu appears and displays "Payment date less than" and "Payment date greater than", so the user can select any of those and get the data filtered accordingly.

I saw a similar solution for Odoo 7 [1]

In the source code
'due_date_from':fields.function(lambda *a,**k:{}, method=True, type='date',string="Due date from"),
'due_date_to':fields.function(lambda *a,**k:{}, method=True, type='date',string="Due date to"),

And in the search view:
<field name="due_date_from" filter_domain="[('date_due','&gt;=',self)]"/>
<field name="due_date_to" filter_domain="[('date_due','&lt;=',self)]"/>

However this doesn't seem to work on Odoo 10.

Any help please?

Thank you very much.

[1]: https://www.odoo.com/forum/help-1/question/search-within-a-period-of-date-14002

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

I have found the best solution to this is an Odoo Community Assocation module:

https://www.odoo.com/apps/modules/10.0/date_range/

You can define any range of dates like "Week One" or "March 1st to 15th" or "2/26/17 to 3/4/27".

The user just has to select:

PAYMENT DATE [in] WEEK ONE.  

The usability is the simplest I have seen. 

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ม.ค. 23
13610
Search within a period of date แก้ไขแล้ว
22
ธ.ค. 23
49223
2
พ.ย. 23
2940
0
พ.ค. 23
2606
2
มิ.ย. 22
7297