Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

Tag Search Filters: How do we add all the tags as filter options?

By
Michael Watchorn
on 11/18/14, 7:31 PM 867 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>

 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 11/18/14, 7:31 PM
Seen: 867 times
Last updated: 3/16/15, 8:10 AM