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

Hi,


I have two date fields "from_date" and "to_date" and if the current date is between or equal to "from_date" or" to_date" I want to get all such records from the model.


How could I search these records??

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

Hello Sebin,


Try this :-

search_obj = self.env['model.name'].search([('from_date', '>=', fields.date.today()), ('to_date', '<=', fields.date.today())])


Hope it works for you.
Thanks,

อวตาร
ละทิ้ง

hi Jignesh Meha,

offers = self.env['offer.sales'].search([('branch_id', 'in', line.branch_id.ids),('from_date', '>=', line.date_order),('to_date', '>=', line.date_order)]) not getting data from offer.sales models

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ต.ค. 23
3419
1
พ.ย. 22
4020
4
ธ.ค. 21
34154
0
มิ.ย. 21
6576
0
มี.ค. 21
3391