Hi,
I'm importing our supplier invoices from another software through API (XML-RPC).
I need to attach the scan PDF for each invoice.
I can't find any documentation about this on the Web.
Do somebody already make it ?
Thanks
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi,
I'm importing our supplier invoices from another software through API (XML-RPC).
I need to attach the scan PDF for each invoice.
I can't find any documentation about this on the Web.
Do somebody already make it ?
Thanks
i might be a bit late, but you simply have to encode it in b64 ;)
I am using this code to upload image to ir.attachment for product.template and it works for me. Hope it will help. Odoo will automatically add records for image_medium and image_small.
$imageBase64 = base64_encode(file_get_contents('path_to_your_file/image.png'));
$models->execute_kw($db, $uid, $password,
'ir.attachment',
'create', // Function name
array( // Values-array
array( // First record
'res_model'=>'product.template',
'name' => 'image',
'res_field' => 'image',
'res_id'=> 1234,
'res_name' => 'product_name',
'type' => 'binary',
'datas' => $imageBase64
)
)
);
The only question i had is to create an attachement i need to request as the following:
$param = array(array(
'res_model'=>'account.invoice',
'res_id'=>95,
'name' => 'myattachement.pdf',
'datas' => '????'
));
$id = $models->execute_kw($db,$uid,$password,
'ir.attachment',
'create',
$param);
My question is How to pass the data ?
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
Hi, check this links,
https://www.odoo.com/documentation/8.0/api_integration.html,
https://doc.odoo.com/6.0/developer/6_22_XML-RPC_web_services/