Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1377 Zobrazení

We are running an Odoo 18.0+e-20241114 (Enterprise-Edition)​ and are using the JSON RPC especially in order to integrate with n8n and Zapier. I have written a JSON RPC that fetches all projects and child stages so we have an extended overview

```

{

  "jsonrpc":"2.0",

  "method":"call",

  "params":{

    "service":"object",

    "method":"execute_kw",

    "args":[

      "{{ $vars.Odoo_database }}",

      {{ $vars. Odoo_API_userID }},

      "{{ $vars.Odoo_API_key }}",

      "project.task.type",

      "search_read",

      [],

      {

        "fields":[

          "id",

          "name",

          "project_ids"

        ]

      }

    ]

  },

  "id": {{ $now.toMillis() }}

}

```

This call fetches results, but they don't reflect the actual current values. E.g. when I rename a stage, this RPC delivers the old names of project and stages.

What could be the issue here? Is there some fixed name that stays and another display name that can be modified? Or is there some caching in place that I need to customize accordingly?

Any help appreciated! Thanks in advance and kind regards
Moritz

Avatar
Zrušit

Are you sure that your database doesn't have multiple languages and thus you only translated it in another language then what is given back by the XML-RPC script? :-)

Autor

@Yenthe you are a genius, thanks a lot. Adding the language as context attribute did the job.

```
{
"jsonrpc": "2.0",
"method": "call",
"params": {
"service": "object",
"method": "execute_kw",
"args": [
"{{ $vars.Odoo_database }}",
{{ $vars.Odoo_API_userID }},
"{{ $vars.Odoo_API_key }}",
"project.task.type",
"search_read",
[],
{
"fields": ["id", "name", "project_ids"],
"context": {
"lang": "de_DE"
}
}
]
},
"id": {{ $now.toMillis() }}
}
```

I cannot transform your comment into (the correct) answer since I am still missing required amount of karma points. When you post this as an answer, I can mark it as correct.

Related Posts Odpovědi Zobrazení Aktivita
1
kvě 25
1119
2
dub 25
1884
1
úno 25
1431
0
led 25
1050
1
pro 24
1750