There is a php file in a server that generate data in json Format.
In the other server, odoo need to get those data from that php file, and then odoo display it.
How could I do this case ? I know this use web service feature concept, but I still have no idea how to implement it to odoo. such where I have to put the script that calling that php file containing json format in the other server.
You need to make an HTTP request on the remote server to download the json document. You can use the urllib2
module from Python's standard library for this (https://docs.python.org/2/library/urllib2.html)
If you don't want the data to appear as raw json in Odoo, you will probably need to parse the json document. You can use the json
module from Python's standard library for this (https://docs.python.org/2/library/json.html?highlight=json#module-json). Then you can store the parsed data in an suitable Odoo Model.
On the other hand, if the raw json is fine, you can just store it in any fields.Text
field of an Odoo model.