Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3343 Lượt xem

We have an API for our organization that serves to validate information like phone/email/address that all our frontend applications use.

We would like to use this API for our Odoo apps as well. 

So basically for instance, if you wish to validate a phone number you just wait for the user to enter something and asynchronously send the info to the API and based on the response let the user know that the phone is either valid or invalid. 

How would I implement this API in an Odoo application?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

on create or write make a call to your external API using python-request and check the validity of phone number.

it's not recommendable to directly call external api from the web client because of 
1) external API could be required authentication (private key) so would not pass it to the web client (browser)
2) external API must be CORS enable but it possible it's not enabled by default or not provide an options 

Ảnh đại diện
Huỷ bỏ
Tác giả

As always, helpful. Thank you Ravi!

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 7 25
170
1
thg 6 25
1863
1
thg 7 25
849
1
thg 4 25
1522
2
thg 1 25
1682