Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
14061 Vizualizări

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

Imagine profil
Abandonează
Cel mai bun răspuns

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,

Imagine profil
Abandonează

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 Răspunsuri Vizualizări Activitate
0
oct. 23
3099
1
nov. 22
3606
4
dec. 21
33472
0
iun. 21
6189
0
mar. 21
2995