Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
1863 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Autore

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?

Post correlati Risposte Visualizzazioni Attività
1
ago 25
405
1
ago 25
662
2
lug 25
3151
3
lug 25
797
1
giu 25
2323