콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
1859 화면

Good day,


We make use of the external API and we're struggling to update our code to work between Odoo 15 and Odoo 16.


We're making use of the documentation here.


Here is my code:

https://github.com/bcity-rburger/odoo-playground/blob/main/odoo-16-api-tests.py


So this code works flawlessly in Odoo 15, returning all fields of the record, with their values, however when running the same code against the same db, but upgraded to Odoo 16, we get a traceback error (see pastebin link here) - I also did a similar test with a clean Odoo 16 db, and get the same results.


What are the adjustments needed to return all values of all fields of a specific record in Odoo 16?


Any help would be highly appreciated.


Regards,
Rayno

아바타
취소
베스트 답변

Hi,

I believe this is a bug in Odoo, for now you can tackle it by specifying the fields(except tax_totals ) you need to read from the model.


fields_to_read = ['name']

sale_order_name = models.execute_kw(db, uid, password, 'sale.order', 'read', [24], {'fields': [fields_to_read]})

Thanks

아바타
취소
작성자

Hey Niyas,

Thanks for the suggestion and you're right, this does work and returns the value of the fields specified.

I know that by using the get_fields I can get a list of all the fields that are available, but do you know if any way that you can combine the read (or search_read) with get_fields to return all the values in one go?

관련 게시물 답글 화면 활동
1
8월 25
402
1
8월 25
659
2
7월 25
3148
3
7월 25
796
1
6월 25
2318