Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to consult with or? #41

Open
jsebasmuller opened this issue Apr 10, 2023 · 5 comments
Open

How to consult with or? #41

jsebasmuller opened this issue Apr 10, 2023 · 5 comments

Comments

@jsebasmuller
Copy link

jsebasmuller commented Apr 10, 2023

Hello friends, I am trying to make a query to sale.order and I want to filter by state, currently I am doing it as follows:

criteria.Add("state", "=", "cancel").Add("state", "=", "draft").Add("state", "=", "sent")
where criteria is a variable NewCriteria()
this seems to work as an "logical operator and" and i need to work it as "logical operator or".

Could you please help me?, thanks for the answers.

@ahuret
Copy link
Collaborator

ahuret commented Apr 11, 2023

Hey @jsebasmuller ! This feature was indeed missing. I added concepts of combined criterions in latest library version 1.6.0 and updated the README accordingly => https://github.com/skilld-labs/go-odoo/tree/v1.6.0#combined-criterions .
I consider this issue as resolved, please reopen it if you have any issue with new implementation.
++

@ahuret ahuret closed this as completed Apr 11, 2023
@jsebasmuller
Copy link
Author

Hello @ahuret that Or function is only available in version 1.6.0? I can't find it in the last ones.

@ahuret
Copy link
Collaborator

ahuret commented Apr 11, 2023

the functions are available in both 1.6.0 and master => https://github.com/skilld-labs/go-odoo/blob/master/odoo.go#L140

@jsebasmuller
Copy link
Author

jsebasmuller commented Apr 11, 2023

Thanks for the help @ahuret , if you want to do more than two conditions, how can you do it? I see that it only receives two conditions in the or function

@ahuret
Copy link
Collaborator

ahuret commented Apr 13, 2023

Hello dear @jsebasmuller , I need to check if it's possible as documentation is not clear to me, and if so I will implement a way to do it. Reopening for now.

@ahuret ahuret reopened this Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants