Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
5957 มุมมอง

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 

อวตาร
ละทิ้ง
ผู้เขียน

so, nobody knows about it? 

คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มี.ค. 16
2918
2
ส.ค. 25
1108
1
เม.ย. 24
2346
Delete product package แก้ไขแล้ว
1
ส.ค. 22
3062
1
ก.พ. 22
3363