Skip to Content
Menu
This question has been flagged
1 Reply
4244 Views

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
Discard
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
Discard
Related Posts Replies Views Activity
2
Sep 24
310
0
Nov 23
722
1
Oct 20
4980
0
Aug 22
3927
2
May 22
9412