This question has been flagged
5353 Views

I'm trying to make all the tags (aka categ_ids) available as search filters.
I have successfully added my own filter "Has Email", and it works. However my template code isn't generating anything, not even errors.

Hopefully you can find something wrong with my template code, or propose another method?

 

<?xml version="1.0"?>
<openerp>
    <data>
    <!--
    Qweb Template for Opportunity Tag Cloud
    -->
        <record id="crm_oppor_search_tags" model="ir.ui.view">
            <field name="name">Opportunity Tag Cloud</field>
            <field name="model">crm.lead</field>
            <field name="inherit_id" ref="crm.view_crm_case_opportunities_filter"/>
            <field name="arch" type="xml">
                <data>
                          <xpath expr="//filter[@string='New Mail']" position="after">
                              <filter string="Has Email" name="has_email"
                            domain="[('email_from', 'ilike', '@')]"/>
                              <separator />
                        <template id="oppor_tags">
                            <t t-foreach="categ_ids" t-as="tag">
                                <filter t-att-string="{{ tag.lower() }}" t-att-name="tag_{{ tag.lower()}}" t-att-domain="['categ_ids','=','{{ tag.lower() }}']" help='Opportunities tagged with the word "{{ tag.lower() }}"'/>
                            </t>
                        </template>
                    </xpath>
                </data>
            </field>
        </record>
    </data>
</openerp>

 

Avatar
Discard