Hi,
I'm new to odoo and I want to call an API when a payment get confirmed, i mean i want to override the confirm function to call a rest API with get method, can anyone give me any example for the code or any helpful links please
Thank you
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi,
I'm new to odoo and I want to call an API when a payment get confirmed, i mean i want to override the confirm function to call a rest API with get method, can anyone give me any example for the code or any helpful links please
Thank you
@api.model
def create(self, values):
record = super(ClassName, self).create(values)
import requests
username = record.username
invoice = record.invoice
credit = record.amount
payment_date= record.payment_date
response = requests.get("http://example.com?user="+ username + "&invoice=" + invoice + "&credit=" + str(credit) + "&date=" +
str(payment_date))
return record
i solved it this way, hope it's helpful to any one
Hi Ali,
Where did you put this code in the ODOO interface ?
I'm trying to do it from a server action but without success .. :(
Thx
Please also try posting your own question. You have asked a new question in the comment of a resolved question, so some people might not think to open the post unless they are interested in the answer to the original question.
Создайте аккаунт сегодня, чтобы получить доступ к эксклюзивным функциям и стать частью нашего замечательного сообщества!
Регистрация| Похожие посты | Ответы | Просмотры | Активность | |
|---|---|---|---|---|
|
2
июл. 24
|
2021 | |||
|
2
мар. 24
|
4334 | |||
|
3
окт. 23
|
6553 | |||
|
0
авг. 21
|
4116 | |||
|
6
окт. 20
|
4181 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.