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

want to return product data to xml-rpc call from php, i can return other fields from product.template but i think odoo stores images in different way, please help how i can get and return images stored in Odoo db to php call through xml-rpc? (there is nothing "how to" in official documentation regarding handling images in rpc calls) screenshot below shows field and object name but failed to find it.

my .php file:

<?php
// following code running successfully to connect & get data from Odoo database running in VM
// Login information
$url = 'http://192.168.18.71:8069';
$url_auth = $url . '/xmlrpc/2/common';
$url_exec = $url . '/xmlrpc/2/object';
$db = 'odb';
$username = 'odoouser@myhost.com';
$password = 'admin';
require_once('ripcord\ripcord.php');
// Login
$common = ripcord::client($url_auth);
$uid = $common->authenticate($db, $username, $password, array());
$models = ripcord::client($url_exec);
$models                 // The (Ripcord) client
    ->execute_kw(       // Execute command
    'table.reference',  // Referenced model, e.g. 'res.partner' or 'account.invoice'
    'search',           // Search method of the referenced model
    array()             // Search domain
);
$result = $models->execute_kw($db, $uid, $password,
               'product.template', 'search_read',
               array(array(array('active', '=', true))),
               array('fields'=>array('id', 'name', 'list_price'), 'limit'=>10));
          //var_dump($result);
foreach ($result as $results) {
 print("{$results['id']} {$results['name']} {$results['list_price']}<br/>");
}
?>

screenshot for reference:


regards 

Avatar
Discard
Author

so, nobody knows about it? 

Best Answer

there is other fields odoo stores images in them like (image_128, image_256, image_512) try image_128

Avatar
Discard
Related Posts Replies Views Activity
0
Mar 16
2205
1
Apr 24
1469
1
Aug 22
1853
1
Feb 22
1846
1
Sep 21
1542