Odoo Help

1 Risposta

We solved it this way:

<filter string="5-6 months" domain="[('date_order', '&gt;=', ((context_today()+relativedelta(months=-6, days=1, weekday=0)).strftime('%Y-%m-%d'))),('date_order', '&lt;=', ((context_today()+relativedelta(months=-5,weekday=6)).strftime('%Y-%m-%d')))]"/>
<filter string="7-11 months" domain="[('date_order', '&gt;=', ((context_today()+relativedelta(months=-11, weeks=-1, days=1, weekday=0)).strftime('%Y-%m-%d'))),('date_order', '&lt;=', ((context_today()+relativedelta(months=-7,weekday=6)).strftime('%Y-%m-%d')))]"/>
<filter string="11-12 months" domain="[('date_order', '&gt;=', ((context_today()+relativedelta(years=-1, weeks=-1, days=1, weekday=0)).strftime('%Y-%m-%d'))),('date_order', '&lt;=', ((context_today()+relativedelta(months=-11,weekday=6)).strftime('%Y-%m-%d')))]"/>
<filter string="12 months+" domain="[('date_order', '&gt;=', ((context_today()+relativedelta(years=-30, days=1, weekday=0)).strftime('%Y-%m-%d'))),('date_order', '&lt;=', ((context_today()+relativedelta(years=-1, weeks=-1, weekday=6)).strftime('%Y-%m-%d')))]"/>
Writer 1 follower(s)