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

Is a join of filters by AND possible?

By
Peter Nietz
on 3/11/15, 11:47 AM 501 views

Hi folks,

when I define filters in my xml view like:

          <filter name="group_latest" string="Latest" domain="[('date', '>=', time.strftime('%Y-%m-%d'))]"/>
          <filter name="lat_north" string="Nördl. Hem" domain="[('geoip_latitude', '>=', 0)]"/>

and I use them both in my view they are joined by OR. But I want them to be exclusive, joined by AND so first filter is applied AND ALSO the second filter is applied on the results of the first filter.

Is this possible?

0
Emanuel Cino
On 3/11/15, 12:31 PM

You could create one other filter this way :

    <filter name="group_latest_north" string="Latest Nördl. Hem" domain="[('date', '>=', time.strftime('%Y-%m-%d')), ('geoip_latitude', '>=', 0)]"/>

Which will apply the AND condition.

that's not what I need. It will increase the complexity to much, cause there are lot more filters implemented and to implement all the combinations of joins (for more than 3 at a time) is not wanted. but thx anyway

Peter Nietz
on 3/12/15, 8:13 AM

Ok sorry. I don't think we can bind predefined filters with AND condition.

Emanuel Cino
on 3/13/15, 1:51 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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 3/11/15, 11:47 AM
Seen: 501 times
Last updated: 3/16/15, 8:10 AM