PHP code example of 0k / php-oe-json
1. Go to this page and download the library: Download 0k/php-oe-json library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
0k / php-oe-json example snippets
$oe = new PhpOeJson\OpenERP("http://localhost:8069", "test_json");
$oe->login("admin", "xxxxxx");
echo "Logged in (session id: " . $oe->session_id . ")";
$partners = $oe->read(array(
'model' => 'res.partner',
'fields' => array('name', 'city'),
));
echo "<ul>";
foreach($partners['records'] as $partner) {
echo " <li>" . $partner["name"] . " - " . $partner["city"] . "</li>\n";
}
echo "</ul>";