跳至內容
選單
此問題已被標幟
1 回覆
14020 瀏覽次數

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

相關帖文 回覆 瀏覽次數 活動
0
10月 23
3096
1
11月 22
3605
4
12月 21
33465
0
6月 21
6184
0
3月 21
2987