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

Hi!,

I've encountered a problem when trying to do a search for obtain records that are current day.

        fecha_actual= datetime.strptime(fields.date.context_today(self,cr,uid,context=context), "%Y-%m-%d").date()
        fecha_actual = fecha_actual.strftime('%Y-%m-%d')

         ingresos = self.search(cr, uid, [('f_ingreso', '>=', fecha_actual+' 00:00:00'),('f_ingreso','<=',fecha_actual+ ' 23:59:59')],context=context)

In trying to make the search only brings back those before 7:00 PM; as if I had my time zone into account for the search.Any idea what might be going?

 

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

It depends on where you are trying to make this search. Please post the entire object

Tác giả

It is a proper model "system.poblacion_ingreso" within the have a button that should make finding records all day. _name = 'delphos.poblacion_ingreso' def check_current_day(self,cr,uid,ids,context=None): fecha_actual= datetime.strptime(fields.date.context_today(self,cr,uid,context=context), "%Y-%m-%d").date() fecha_actual = fecha_actual.strftime('%Y-%m-%d') ingresos = self.search(cr, uid, [('f_ingreso', '>=', fecha_actual+' 00:00:00'),('f_ingreso','

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 7 25
3462
1
thg 1 24
1569
1
thg 2 22
4678
2
thg 3 25
1913
1
thg 4 17
4854