Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
5187 Vizualizări

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?


Imagine profil
Abandonează
Cel mai bun răspuns

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.

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
sept. 24
2129
0
nov. 23
2027
1
oct. 20
6702
0
aug. 22
5765
2
mai 22
10872