曾经尝试通过php自动验证odoo 10中的发票,但暂时没有成功。我正在使用以下php代码进行验证
<?php
$url = 'http://localhost:8069';
$url_auth = $url . '/xmlrpc/2/common';
$url_exec = $url . '/xmlrpc/2/object';
$db = 'DATABASE';
$username = 'Username';
$password = 'Password';
require_once('ripcord/ripcord.php');
$common = ripcord::client($url_auth);
$uid = $common->authenticate($db, $username, $password, array());
$models = ripcord::client("$url/xmlrpc/2/object");
$invoice_model = 'account.invoice';
$id = $models->exec_workflow(
$db, $uid, $password,
'account.invoice',
'invoice_open',
2948 //invoice Id
);
print_r($id);
当我执行以上操作时,我没有任何结果。没有错误信息,什么都没有。
答案 0 :(得分:1)
@ThongNguyenVan给了我所需的提示。它导致我进入https://www.odoo.com/nl_NL/forum/help-1/question/odoo10-sending-invoice-email-via-xmlrpc-118915,基本上有了我需要的Python版本的代码。因此它将转换为以下PHP代码:
$models->execute($db, $uid, $password, 'account.invoice', 'action_invoice_open', array(2948));
答案 1 :(得分:0)
invoice_open
中没有方法account.invoice
,但是有action_invoice_open
。您可以再检查一次吗?
参考:https://github.com/odoo/odoo/blob/10.0/addons/account/models/account_invoice.py#L576