Odoo How to develop a workflow in php for the invoice in XML-RPC? -
i seek force invoice of ecommerce platform odoo. (php - xml-rpc) invoice created haven't find how create workflow alter status in odoo.
i found on net think it's old , it' doesn't work odoo openerp v6 or 7.
nb : link : http://goo.gl/lbpwng
//validate invoice echo "validate<br /><br />"; $conn->workflow('account.invoice', 'invoice_open', $invoice_id);
do have thought ?
thank you
my code in xml-rpc when create invoice in odoo.
// ********************************** // write new concerning shipping service line // ********************************** // invoice line $shipping_account_id; // id ofaccount shipping 626000 $val = array ( "invoice_id" => new xmlrpcval($invoice_id, "int"), "account_id" => new xmlrpcval($shipping_account_id, "int"), "company_id" => new xmlrpcval($company_id, "int"), "product_id" => new xmlrpcval($odoo_products_id, "string"), "name" => new xmlrpcval('service postale', "string"), "quantity" => new xmlrpcval('1',"double"), "price_unit" => new xmlrpcval('20',"double"), ); $client = new xmlrpc_client($server_url . "/xmlrpc/object"); $client->setsslverifypeer(0); $msg = new xmlrpcmsg('execute'); $msg->addparam(new xmlrpcval($dbname, "string")); $msg->addparam(new xmlrpcval($uid, "int")); $msg->addparam(new xmlrpcval($password, "string")); $msg->addparam(new xmlrpcval("account.invoice.line", "string")); $msg->addparam(new xmlrpcval("create", "string")); $msg->addparam(new xmlrpcval($val, "struct")); $response = $client->send($msg);
here method used create invoice order , i'm using odoo .
public function createinvoicefromdraft() { $saleid = $_request['customerid']; $oerp = new openerp(); $oerpuserid = $oerp->login($_session['oerp-username'], $_session['oerp-password']); //workflow confirming order $r = $oerp->workflow('sale.order', 'order_confirm', $saleid); $result = $oerp->workflow('sale.order', 'manual_invoice', $saleid); $fields = array('name'); $readname = $oerp->searchread(array(array('id','=',$saleid)), 'sale.order', $fields); $ordername = $readname[0]['name']; $fields = array('id'); $id = $oerp->searchread(array(array('origin','=',$ordername )), 'account.invoice', $fields); $invoiceid = $id[0]['id']; $result .= $oerp->workflow('account.invoice', 'invoice_open', $invoiceid); homecoming $result; }
php workflow xml-rpc invoice odoo
No comments:
Post a Comment