تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
5467 أدوات العرض

I need to make in the python code a search for records and it should show me all records between two dates.


start_date between 15:00 and 15:30

end_date between 15:00 and 15:30


and it should show me all record that matches this filter


I need it to do in python with the .search method:

self.env['mrp.workorder'].search([]) 


any help? thank you 

الصورة الرمزية
إهمال
أفضل إجابة

Hi Wizardz,

You can add new boolean compute field with store=True and depends on start_date and end_date.

In compute method you can check the time of start and end date if it between 15:00 to 15:30, set boolean field value true.

Then use that field in the search method.

Regards,

Hemangi.

الصورة الرمزية
إهمال
الكاتب

I don't know how I can filter it inside the .search method.

المنشورات ذات الصلة الردود أدوات العرض النشاط
2
مايو 25
851
2
يناير 23
13843
1
ديسمبر 20
21239
22
ديسمبر 23
49466
2
نوفمبر 23
3142