Helloooooooooooooooooooooooo there!
Admit that we are march 7th.
I want a filter who accepts only date of the current month and the last month.
So I want a filter who accepts date from february 1st to march 31th (but I won't have document dated after the march 7th).
Is my filter ok?
XML filter :
<filter string="Current and last months" name="currentandlastmonths"
domain="[
('date','>=',(context_today()-relativedelta(months=1)).strftime('%Y-%m-01')),
('date','<',(context_today()+relativedelta(months=1)).strftime('%Y-%m-01'))
]" />
Edit #1
Interesting link to learn about this kind of filter. Many examples there :
http://odoobyriyasshon.blogspot.ca/2015/07/search-view-filters-in-odoo.html
You have to be careful though, because the link you provided will not take timezone into account.