Se rendre au contenu
Menu
Cette question a été signalée
1365 Vues

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
Ignorer

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? :-)

Auteur

@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.

Publications associées Réponses Vues Activité
1
mai 25
1115
2
avr. 25
1875
1
févr. 25
1426
0
janv. 25
1049
1
déc. 24
1747