Odoo Node - filter "in" operators return an Error

Describe the problem/error/question

When I choose “Get Many” Operation with a filters based on an “in” operation I received an error.

What is the error message (if any)?

Invalid domain term (‘id’, ‘in’, ‘[1677]’)

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.80.3
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Mac
1 Like

Hey @Guldan,

Please try these options:

  • Parenthesis: (1677)
  • Number only: 1677

Some SQL languages use parenthesis for the IN operator.
But n8n could also be using some formatting in the backend.

So let’s say you have an array of three numbers, maybe you have to use one of the formats below:

  • (1677, 1523, 2744)
  • 1677, 1523, 2744

If my reply answers your question, please remember to mark it as a solution.

Thanks @solomon

I tried the two options and I had the same error.

I think the domain should not be (‘id’, ‘in’, ‘[1677]’) but (‘id’, ‘in’, [1677])
(Array without ‘’)

This is a bug within the n8n core in this part of the function call.

The filter should allow for proper Type conversion.

I got it working with a code update. I created this issue and am submitting a pull request right now.

Issue: Odoo domain filter does not work on custom resource · Issue #13996 · n8n-io/n8n · GitHub
Pull Request: feat(core): Allow domain filter (#13996) by cgsmith · Pull Request #13998 · n8n-io/n8n · GitHub

Thanks @cgsmith

Hey there. I created a PR that added @cgsmith changes here. Hope it helps.

@cgsmith, I referenced you but as I had already ported your changes to my local instance, and am not planning on working too much or at all on n8n in the future, I pushed it as is to benefit the community.

If that kind of thing is bothering you in any way, feel free to let me know and I’ll remove your changes from my PR or find a bette way to make sure your contribution is accounted properly.

Easy solution would be that you PR be merged beforehand I guess.

1 Like

Nice read, good to see how it works backend :slight_smile: thanks

I am encountering the same issue when trying to filter multiple leads using the IN operator like this: [1223, 1224].

I went through the threads but still don’t fully get it. Is this a bug that requires someone experienced with Odoo to resolve?

Thanks

Hey there, you currently have these choices :

  1. Install nothing, use an HTTP request node and learn how to do a JSONRPC request to Odoo database, but using hard-coded credentials in body…
  2. Setup the node provided here on your n8n instance and use the domain filter option from @cgsmith to fetch what you want using odoo search domains
  3. Wait for the n8n team to approve that upgrade to the Odoo node and same as option 2
1 Like