Odoo Help


filter on current week

on 12/8/16, 3:32 AM 1,279 views


i wanted to know how to filter by reord for the current week from monday that means if today is monday i want all the record from today to next monday if we are sunday i want all the record from last monday to next monday no matter which day we are i want from this week monday to the next

thanks a lot

Burhan Vakharia
On 12/8/16, 7:24 AM

Hello brami,

You can create a filter like this,

<filter string="Current Week" name="Current Week" domain="[('date','&lt;',(context_today()+relativedelta(days=7)).strftime('%Y-%m-%d 23:59:59')), ('date','&gt;=',context_today().strftime('%Y-%m-%d 00:00:00'))]"/>

This will give you the filter you require for the current week. For eg, if today is Monday then records till next Monday.

Hope this helps,

Thank You.

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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 12/8/16, 3:32 AM
Seen: 1279 times
Last updated: 12/8/16, 7:24 AM