Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
Using the ir.filters model on Odoo V8 i'm trying to get all records within the previous hour. The following does not work. 'date' is a datetime field.
['date', '>', ( (context_today() - datetime.timedelta(hours=1)).strftime('%Y-%m-%d %H:%m:%S') ) ]
If I remove the time element %H:%m:%S then there are no errors but truncates to midnight so returns all records today which I would expect but not what I want. I've read that you may have to use datetime.combine but am unable to get this working without hardcoding the hours / minutes / seconds.
Can anyone give me an example of how to achieve what should be a simple filter option.
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 4/16/18, 8:35 AM|
|Seen: 101 times|
|Last updated: 4/16/18, 8:56 AM|