Giter VIP home page Giter VIP logo

Comments (6)

hbrunn avatar hbrunn commented on July 30, 2024

the trick is that you need to submit your search after the first selection. If you add conditions in advances search, the terms will be joined by conjunction. If you apply first, and then add the second condition, you'll get the disjunction.

from web.

rafaelbn avatar rafaelbn commented on July 30, 2024

Hi @hbrunn , I leaved this without answer and without solving.

Let's say conditions in Projects.

  • A: is manager (res.user) = 145 results
  • B: is member (res.user) = 15 results
  • C: is follower (we want follower for res.user and not from res.partner) = 149 results

I'm looking (in this example) for A OR B OR C = 154

the trick is that you need to submit your search after the first selection. If you add conditions in advances search, the terms will be joined by conjunction. If you apply first, and then add the second condition, you'll get the disjunction

I'm not able to reproduce this, as you said me. I think I was using you trick and that why I said module has a [BUG]

In Odoo core: (Go to Projects -> projects)

1 - If you want to make disjunction, A OR B, you have to select first condition (A=is manager), add second codition (B=is member), ... and after all conditions are added click in the button Apply.

  • Unfold advance search, select field "Project manager", set "is equal", select your own user
  • Click add condition
  • Select field "Project members", set "is equial", select your own user
  • Click Apply
  • A OR B = 148 results

2 - If you want to make conjunction, A AND B, you have to select first condition (A=is manager), apply, add second codition (B=is member), aplpy, ...

  • Unfold advance search, select field "Project manager", set "is equal", select your own user
  • Click Apply
  • Unfold advance search, select field "Project members", set "is equial", select your own user
  • Click Apply
  • A AND B = 12

Adding module OCA web_advanced_search_x2x

3 - So with my search (I would like to filter projects which User (uid) is "manager" OR "member" OR "follower".) and you comment I did:

  • Case 3.1
    • Point 1 described above (A OR B) +
    • C: Unfold advance search, select field Follower -> Is in selection and then in res.parter search User -> you own user
    • A OR B AND C = 143
  • Case 3.2
    • Unfold advance search, select field Follower -> Is in selection and then in res.parter search User -> you own user
    • Unfold advance search, select field "Project manager", set "is equal", select your own user
    • Click add condition
    • Select field "Project members", set "is equial", select your own user
    • Click Apply
    • A OR B OR C = 53 --> incorrect, here is the BUG

Could you tell me if I'm missing the trick?

Additionaly
  • How can we do/improve this module to be able for excluding a selection?
    • Let's say you have 3 mailing list (m1[rafaelbn], m2[hbrum], m3[rafaelbn,hbrum]) lists and in customers you want to search all customer which are not in mailng list m1. Result now if you make "is in selection"+"mailing list is not equial to m1" is rafaelbn,hbrum (because they are in m2 or m3). But we would like logic for "is not in selection"+
    • We think that we must add the option "is not in selection". Did you not include it for any special reason?

from web.

hbrunn avatar hbrunn commented on July 30, 2024

@rafaelbn thanks for elaborating, it's fixed in #263

from web.

hbrunn avatar hbrunn commented on July 30, 2024

About your other questions: negative operators on x2many fields in odoo are nearly never treated the way a user would expect, so implementing it on this level is a recipe for frustration.

For your use cases, use https://github.com/OCA/web/tree/7.0/web_advanced_filters

from web.

rafaelbn avatar rafaelbn commented on July 30, 2024

@pedrobaeza @antespi if we want to implement negative operator we must take care on #222 (comment) and maybe discuss with @hbrunn

from web.

rafaelbn avatar rafaelbn commented on July 30, 2024

Solved in #263

from web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.