openerp-community team mailing list archive
Mailing list archive
Re: How to use datetime + timedelta on odoo filters
Holger Brunn <hbrunn@xxxxxxxx>
Mon, 29 Sep 2014 07:48:21 +0200
KMail/4.14.1 (Linux/3.16-2-amd64; KDE/4.14.1; x86_64; ; )
> If user timezone is GMT-6:00, then any of current "Today" filters will
> filter only records from tomorrow if current local time is after 18:00
> (18:00 + 6:00 = 24:00 -->> next day).
this is caused by https://bugs.launchpad.net/ocb-server/7.0/+bug/1255612, my
patch should still work for 8.0, I think:
> I was trying to adjust for that replacing time.strftime('%Y-%m-%d') with
> as all records created today after 18:00 will have a database timestamp of
> Problem is JS complains about invalid operands for "+": datetime and
That's because the '+' operator is only defined on timedelta + timedelta:
> Any idea how could this be acomplished ?
but I think you won't be completely happy with that, as what you actually want
to search for is presumingly:
[utc representation of $localdate 00:00:00] <= date_field <= [utc
representation of $localdate 23:59:59]
and that's where the above patch comes in handy.
Therp - Maatwerk in open ontwikkeling
Holger Brunn - Ontwerp en implementatie
Description: This is a digitally signed message part.