Odoo Help


Domain Filter in Search View

on 3/29/13, 8:49 AM 3,416 views

The following domain addition throwing a error while using department_id field in search view.

And tried the openerp doc doc.openerp.com/v6.0/developer/2_6_views_events/views/search_view.html#fields

How can i solve this?

<field name="type">search</field>            
<field name="arch" type="xml">
   <search string="Home">
          <field name="company_id"/>
          <field name="department_id" domain="[('company_id','=',company_id)]"/>

Thanks in advance


Cyril Gaspard (GEM)

--Cyril Gaspard (GEM)--
Cyril Gaspard (GEM)
| 5 6 8
Paris, France
--Cyril Gaspard (GEM)--

Forum contributor since 2008

Cyril Gaspard (GEM)
On 3/29/13, 9:47 AM



<field name="department_id" domain="[('company_id','=',context.get('company_id', False)]"/>


While using the suggested condition the following error popup ValueError: Error during evaluation of this domain: "[('company_id','=',company_id.id)]", message: "name 'company_id' is not defined"

on 3/30/13, 8:13 AM

answer update

Cyril Gaspard (GEM)
on 4/2/13, 5:43 AM

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 platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 3/29/13, 8:49 AM
Seen: 3416 times
Last updated: 3/16/15, 8:10 AM