跳至內容
選單
此問題已被標幟
1 回覆
1005 瀏覽次數

Hi,


When I want to get project names via the API, I get the original names instead of the current ones.

Am I missing something in the query ?


projects = models.execute_kw(

    db, uid, password,

    'project.project',

    'search_read',

    [],

    {

        'fields': [

            'id', 'display_name', 'name'

        ]

    }

)


Thanks.


Ayman

頭像
捨棄
作者

Thanks Laura. That works !

最佳答案

I found the answer to this problem here: https://www.odoo.com/fr_FR/forum/aide-1/why-does-the-json-rpc-return-outdated-data-solved-268870?msockid=01f063b446826ed027d7762a473f6f1d

In your case:

projects = models.execute_kw(

​db, uid, password,

​'project.project',

​'search_read',

​[],

​{

​'fields': [

​'id', 'display_name', 'name'

​],

​'context': {

​'lang': "en_US"

​}

​} )

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
1月 25
1121
0
9月 24
4
0
9月 24
1315
1
6月 24
1912
1
3月 24
2257