Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
1838 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Autor

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?

Publicaciones relacionadas Respuestas Vistas Actividad
1
ago 25
392
1
ago 25
653
2
jul 25
3138
3
jul 25
795
1
jun 25
2310