← Back to team overview

openerp-community team mailing list archive

Re: How to use datetime + timedelta on odoo filters

 

> Great for relativedelta !!  Have you tried it on odoo 8?

no, but it should be simple to port if there's anything to do at all.

[...] 
> If user is in time zone GMT-6:00, records from one day will be stored on
> database between 6:00 same day and 5:59 next day.  Your patch will try to
> filter records from 18:00 same day to 17:59 next day...
> We need to add the time delta, not substract it...

yes, you're right of course.

[...]
> Please test it and provide feedback as to how to include this somewhere...

PR it into my branch, after another week of inactivity I'll propose this to 
OCB.

On Saturday, October 04, 2014 03:13:03 you wrote:
> Also, using in filters
>     (datetime.datetime.now()+relativedelta(hours=6)).strftime('%Y-%m-%d
> %H:%M:%S')
> is  not working on v8.  Would this be solved with web_relativedelta module ?
> I checked and it is not in use even on 7.0...

This can't work with the original, as it doesn't support datetime as operands 
for relativedelta. web_relativedelta is meant to solve that problem, too

-- 
Therp - Maatwerk in open ontwikkeling

Holger Brunn - Ontwerp en implementatie

mail: holger@xxxxxxxx
web: http://therp.nl

Attachment: signature.asc
Description: This is a digitally signed message part.


References