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.

0

Domain Filter in Search View

By
Sathiyan
on 4/25/13, 5:35 AM 1,173 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)]"/>
   </search>
</field>

Thanks in advance

0

Francesco OpenCode

--Francesco OpenCode--
3608
| 5 7 9
Grottaglie, Italy
--Francesco OpenCode--

Italian Odoo (OpenERP) Modules Developer LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

Francesco OpenCode
On 4/25/13, 6:09 AM

In the search view is not possibile insert a domain relative to another field. You can only use the value of the some field to set parameters about it self or some particular parameters like uid, for example. If you read the example at the link you post, you can see

<field name="location_id" string="Location"
       filter_domain="['|',('location_id','ilike',self),('location_dest_id','ilike',self)]"/>

where the filter_domain are applied to self value (location_id value)

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

0 follower(s)

Stats

Asked: 4/25/13, 5:35 AM
Seen: 1173 times
Last updated: 3/16/15, 8:10 AM