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

I'm new to the Odoo api, and trying to figure out how to get some fields is quite hard.

What I want to find is for example the 'payment_method_id'. In a sale.order it looks like, 'payment_method_id': [3,'adyen_eur']. But I only have the 'adyen_eur' part of the payment_method_id, so to get the int 3 I have to 'search_read' some database, but which one?

To make it a bit more clear I do the same for 'country_id'. What I have is:

country_code = 'GB'

To get the country_id I do:

country_id = models.execute_kw(db, uid, password, 'res.country', 'search_read',[[('code','=',country_code)]])[0]

The integer that comes out of the country_id is what I need. In the same way I want to get the payment_method_id and workflow_process_id. Is there a database like 'res.country', 'order.sales' ,... where I can find these Id's?


Avatar
Descartar
Mejor respuesta

you can get the data from model payment.acquirer and provider name is 'adyen'. In this model saves all data related with payment acquirers used in odoo. Here there is a column named provider which saves the name of payment acquirer.

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
sept 24
2088
0
nov 23
2004
1
oct 20
6664
0
ago 22
5723
2
may 22
10804