Skip to Content
Menu
This question has been flagged

Trying to set a default filter for the calendar module

Tried the following code, but it is not working

 <record id="view_calendar_event_search_extn" model="ir.ui.view">
        <field name="name">calendar.event.search</field>
        <field name="model">calendar.event</field>
        <field name="inherit_id" ref="calendar.view_calendar_event_search"/>
        <field name="arch" type="xml">
           <search string="Search Meetings">
            <filter string="All Meetings" name="all_meetings" domain="[('Privacy','=','Everyone')]"/>
           </search>
        </field>
    </record>
    <record id="calendar_filter" model="ir.actions.act_window">
            <field name="name">Calendar</field>
            <field name="res_model">calendar.event</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form,pivot,graph</field>
            <field name="view_id" eval="False"/>
            <field name="domain" eval="[('Privacy','=','Everyone')]"/>
            <field name="context">{'search_default_all_meetings': 1}</field>
            <field name="search_view_id" ref="view_calendar_event_search_extn"/>
            <field name="view_ids"
                   eval="[(5, 0, 0),
                          (0, 0, {'view_mode': 'form', 'view_id': ref('calendar.view_calendar_event_form_popup')}),
                          ]"/>
    </record>

Avatar
Discard
Best Answer

Try this:

<filter string="All Meetings" name="all_meetings" domain="[('privacy','=','public')]"/>

Avatar
Discard
Related Posts Replies Views Activity
1
Jun 21
2795
0
Aug 19
1953
1
Jun 24
3663
0
May 24
329
0
Feb 24
533