Hi guys,
I got an error when I try to add a new contact to Odoo by using Custom Resource.
Erro message: Database fetch misses ids ((‘13’,)) and has extra ids ((13,)), may be caused by a type incoherence in a previous request
My Workflow
I’m using the latest version of N8N. Hope these info help.
Thanks in advance.
Hey @semighoti, this is an error coming from the Odoo API and I am not quite sure what it means. Seems like the ID 13 doesn’t exist where your Odoo instance would be expecting it.
In the past I have seen some fields requiring an array format. In n8n this could be achieved through an expression like {{[13]}}
, see here: Odoo node ecommerce category, pricelist and image/attachment issues - #9 by MutedJam
Does this perhaps also work for your field?
Hi @MutedJam, Thanks for the answer.
{{[13]}}
does not work in my case. Invalid Syntax.
Not sure if you know this, but 13 is California; 233 is US country. I get them from here
Here is the problem. When I chose Resource as Contact and transferred Customer info into Odoo, N8N worked. The country ID is 233; and the State ID is 13 as in screenshot 2.
But if I choose Resource as Custom Resource, then Custom Resource as Contact and input the same value in State ID and Country ID, it does not work (Screenshot 1). I want to add more things such as Loyal Points for Customers when they sign up for Loyalty Program, so I need to set up n8n as in the first screen shot.
I figured out a way to work around this issue, but the solution would be great for other people who have the same problem and want to learn more about the N8N-Odoo progress.
Thanks for the help @MutedJam, I appreciate it very much
Hey @semighoti, sorry for the misunderstanding, I had adding {{[13]}}
as an expression in mind. Could you try clicking on the little gears icon next to the field and select Add Expression?
Let me know if this still fails and I’ll see if I can reproduce this with any of the test instances @Lunoba shared the last time Odoo was causing trouble.
1 Like
Hi @MutedJam, {{[13]}}
did not work, but {{13}}
worked perfectly. Thanks a lot. Now I understand more Odoo’s Syntax. I appreciate that very much.
2 Likes
Glad to hear this works, thanks so much for confirming!
Tbh, I think this might be a problem not with Odoo but with n8n not sending the correct format (unless your force it through an expression). I’ll add this to our internal bug tracker for a closer look.
1 Like