This question has been flagged
2 Replies
7533 Views

I'm using Odoo v8. In the leads list view I'd like to add a second filter by default so the list shows all leads which are either Unassigned (default Odoo) OR assigned to current user.

Can someone paste a quick example of a custom module to do this?

I've done lots of Googling and reviewing the documentation but it's not clear to me how I would even start with this modification.

Thanks.

Avatar
Discard
Best Answer

check the crm_partner_assign module available in Addons

        <record model="ir.ui.view" id="crm_opportunity_partner_filter">
            <field name="name">crm.opportunity.partner.filter.assigned</field>
            <field name="model">crm.lead</field>
            <field name="inherit_id" ref="crm.view_crm_case_opportunities_filter"/>
            <field name="arch" type="xml">
                <filter string="Team" position="after">
                    <filter string="Assigned Partner" icon="terp-personal" domain="[]" context="{'group_by':'partner_assigned_id'}"/>
                </filter>
                <field name="partner_id" position="after">

                    <field name="partner_assigned_id"/>
                </field>
            </field>
         </record>

Avatar
Discard
Best Answer

Alternatively i guess you can use the GUI interface and interact with custom filters,

in order to disable the default filter in the search field just click on the arrow that is directed down next to the "x"

click on the " Unassigned " in order to disable the selection ( in the " Filters " section )

click on the down facing arrow on " save current filter " than choose the " myleads " or any other filter that you would like to use

Name your custom filter then click on " use by default " and finaly save it  !

Here you go ! without any scripting done ! :)

Avatar
Discard

Yep a simple GUI solution that needs no programming is always nice! Good suggestion :)