Odoo Help


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.


How filter a field with domain with eval expression?

Franco Tampieri
on 6/10/14, 12:42 PM 1,588 views

Hi guys,

I've created a module where I put some new category of product that will be created by xml.

So I'have to filter some field with domain, like 'categ_it', '=', xml_id, but i try to eval=ref('xml_id') but without success.

Does anyone have some solution or exampel to suggest me?

I don't want to put normal integer id to filter fileds, I want a more generalized and dynamic option :)



I'd love an answer to that as well...

Henri-Maxime Ducoulombier
on 11/18/14, 5:20 AM

Yannick Vaucher

--Yannick Vaucher--
| 5 7 9
Lausanne, Switzerland
--Yannick Vaucher--
Yannick Vaucher
On 1/16/15, 7:55 AM

In 8.0 I did the following to make domain based on XML ID:


When creating an ir.actions.act_windows


        <field name="domain" eval="[('categ_id', '=', ref('xml_id'))]"/>


Though, if you need to create a filter you will have to write:


          <filter string="My filter" name="my_filter" domain="[('categ_id', '=', %(xml_id)d)]"/>


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)


Asked: 6/10/14, 12:42 PM
Seen: 1588 times
Last updated: 3/16/15, 8:10 AM