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

Hi,

i call method validate invoice with php webservice, 

<?php

require_once('konek.php');

require_once('ripcord/ripcord.php');
$common = ripcord::client("$url/xmlrpc/2/common");
$common->version();

$uid = $common->authenticate($db, $username, $password, array());
$models = ripcord::client("$url/xmlrpc/2/object");

$id_invoice = 20; #id invoice

$data = $models->execute_kw($db, $uid, $password,'account.invoice', 'action_invoice_open', [$id_invoice]);

echo json_encode($data);

?>


process is success to validate invoice, but respond is TypeError: cannot marshal None unless allow_none is enabled.

how to solve this problem?

Avatar
Discard
Best Answer

it's a known limitation of XML-RPC. XML-RPC does not allow None data type as payload unless you explicitly pass aloow_none but for the back worked compatibility reason odoo didn't enable the nil extension.

So here the issue is either sending data to the server has None value or server return None result. 
In most of cases when you call any server method and it didn't return anything then python by default return None. so you have to explicitly return True, False, etc...

so make sure `action_invoice_open` return action(dict) instead of None.

ref: https://github.com/odoo/odoo/issues/12289

Avatar
Discard
Related Posts Replies Views Activity
1
Oct 24
1833
1
Apr 24
1902
2
Mar 24
2488
0
Sep 23
1506
1
Jun 23
1979