Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
14265 Lượt xem

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??

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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,

Ảnh đại diện
Huỷ bỏ

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 10 23
3417
1
thg 11 22
4019
4
thg 12 21
34145
0
thg 6 21
6575
0
thg 3 21
3389