In una vista, il codice 
'type': 'leads' dovrebbe distinguere fra leads e opportunity,
che sono insieme in crm.lead
<button class="oe_inline oe_stat_button" 
                            type="action" 
                            attrs="{'invisible': [('customer', '=', False)]}"
                            name="%(partner_leads_tree)d"
                            icon="fa-bell"
                            context="{'search_default_partner_id': active_id, 'type': 'leads'}"
                            help="Show the number of Leads of this partner"
                            >
                    <field string="Leads" name="lead_count" widget="statinfo"/>
                </button>
ma... non lo fa 
Nemmeno filtra e mette solo le opportunità (il contrario)
questa
context="{'search_default_partner_id': active_id, type:'opportunity'}"
Provo ad usare quindi domain:
domain = "[('type','=','opportunity')]"
<button class="oe_inline oe_stat_button" 
                            type="action" 
                            attrs="{'invisible': [('customer', '=', False)]}"
                            name="%(partner_leads_tree)d"
                            icon="fa-bell"
                            context="{'search_default_partner_id': active_id}"
                            help="Show the number of Leads of this partner"
                            >
                    <field string="Leads" name="lead_count" widget="statinfo" domain="[('type', '=', 'opportunity')]" />
                </button>Niente.
Poi mi sono accorto che lavoraro sul bottone e non sull'azione di finestra!!
<field name="domain">[('type', '=', 'lead')]</field>
ma andava messo nel
<record model="ir.actions.act_window" id="partner_leads_tree">
            <field name="name">Leads of a specific partner</field>
            <field name="res_model">crm.lead</field>
            <!-- metto view type = tree  ?     -->
            <field name="view_type">form</field>
            <field name="view_mode">tree,form,graph</field>
            <field name="context">{
                'search_default_partner_id': active_id, 
                }
            </field>
            <field name="domain">[('type', '=', 'lead')]</field>
          
            <field name="arch" type="xml">
                <tree string="Iniciativa_por_cliente">
                    <field name="date"/>
                    <field name="partner_id"/>
                </tree>
            </field>
        </record>