İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
1840 Görünümler

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

Avatar
Vazgeç
En İyi Yanıt

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

Avatar
Vazgeç
Üretici

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?

İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Ağu 25
394
1
Ağu 25
654
2
Tem 25
3138
3
Tem 25
795
1
Haz 25
2310