Ir al contenido
Menú
Se marcó esta pregunta
1385 Vistas

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
Descartar

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.

Publicaciones relacionadas Respuestas Vistas Actividad
1
may 25
1123
2
abr 25
1886
1
feb 25
1432
0
ene 25
1052
1
dic 24
1754