<field name="arch" type="xml">
<search string="Campaign Analysis">
<group>
- <filter icon="terp-go-year"
- string="This Year"
+ <filter icon="terp-go-year" name="year"
+ string="Year"
domain="[('year','=',time.strftime('%%Y'))]"/>
+ <separator orientation="vertical"/>
+
<filter icon="terp-go-month"
- string="This Month"
+ string="Month" name="This Month"
domain="[('month','=',time.strftime('%%m'))]"/>
+ <filter icon="terp-go-month" string=" Month-1 "
+ domain="[('create_date','<=', (datetime.date.today() - relativedelta(day=31, months=1)).strftime('%%Y-%%m-%%d')),('create_date','>=',(datetime.date.today() - relativedelta(day=1,months=1)).strftime('%%Y-%%m-%%d'))]"/>
+
<filter icon="terp-go-today"
string="Today"
domain="[('date','=',time.strftime('%%Y/%%m/%%d'))]"/>
<field name="res_model">campaign.analysis</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
- <field name="context">{'group_by': [], 'search_default_Campaign': 1, 'search_default_Segment': 1, 'group_by_no_leaf':1}</field>
+ <field name="context">{'search_default_year': 1,"search_default_This Month":1,'group_by': [], 'search_default_Campaign': 1, 'search_default_Segment': 1, 'group_by_no_leaf':1}</field>
<field name="search_view_id" ref="view_campaign_analysis_search"/>
</record>