Skip to Content
Menu
This question has been flagged
1 Odpoveď
5178 Zobrazenia

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
Zrušiť
Best Answer

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
Zrušiť
Related Posts Replies Zobrazenia Aktivita
2
sep 24
2103
0
nov 23
2011
1
okt 20
6682
0
aug 22
5740
2
máj 22
10829