I'm trying to get an invoice in it's pdf version , but the example en the docs only guide me to this result:
array (size=2)
'faultCode' => int 2
'faultString' => string 'None' (length=4)
I've been trying to find what the faultCode 2 means but no luck at all. Can you provide me any working example or documentation? I'm using this source code:
<?php
require_once('ripcord.php');
$url = "http://xxx.viennaresidence.com";
$db = "odoo.yaidel";
$username = "development@worldwideresidence.com";
$password = "xxx";
$common = ripcord::client("$url/xmlrpc/2/common");
$uid = $common->authenticate($db, $username, $password, array());
$models = ripcord::client("$url/xmlrpc/2/object");
$invoice_ids = $models->execute_kw(
$db, $uid, $password,
'account.invoice', 'search',
array(
array(
array(
'type',
'=',
'out_invoice'
),
array(
'state',
'=',
'open'
)
)
)
);
/*
var_dump($models->execute_kw(
$db, $uid, $password,
'ir.actions.report.xml', 'fields_get',
array(),
array('attributes' => array('string', 'help', 'type'))
));
*/
echo "<b>Invoices Opened</b>";
var_dump($invoice_ids);
$report = ripcord::client("$url/xmlrpc/2/report");
/*
echo "<b>Report XMLRPC Object</b>";
var_dump ($report);
*/
$result = $report->render_report(
$db, $uid, $password,
'account.report_invoice', 8);
/*
echo "<b>Report XMLRPC Object after Call</b>";
var_dump ($report);
*/
echo "<b>Result of calling the Render Report</b>";
if (isset($result['faultCode'])) {
var_dump($result);
} else {
$report_data = base64_decode($result['result']);
}
?>
Thanks in advance.