Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
775 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks Laura. That works !

Câu trả lời hay nhất

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"

​}

​} )

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 1 25
837
0
thg 9 24
4
0
thg 9 24
1183
1
thg 6 24
1637
1
thg 3 24
2023