Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
2 Respostas
8137 Visualizações

require_once('ripcord/ripcord.php');

$common = ripcord::client($url.'/xmlrpc/2/common');

$uid = $common->authenticate($db, $username, $password, array());

$models = ripcord::client("$url/xmlrpc/2/object");

$sales_order = $models->execute_kw($db, $uid, $password,

    'sale.order', 'action_button_confirm',

     array(array(25918))); //Quotation ID here

var_dump($sales_order);


am getting the error as 

website_sale_autopay_models.py", line 29, in action_button_confirm if (r.payment_tx_id and r.payment_tx_id.state == 'done' and r.payment_acquirer_id) or (context.get('is_sale_order')): AttributeError: 'NoneType' object has no attribute 'get' ".

While this code is running fine on different database. 

Avatar
Cancelar
Autor Melhor resposta

Thanks for your valuable reply. I have tried the same as you have assisted, But it is not working for me.. 

$sales_order = $models->exec_workflow($db, $uid, $password,

'sale.order', 'action_button_confirm',25931);  //Sales Order ID

var_dump($sales_order);
I am getting the result as "bool(false)" while Manualy the button is working fine. Kindly help to solve it.



Avatar
Cancelar
Melhor resposta

you will confirm sale order by xmlrpc using below code. Here sale_order_id is the id of the sale order, that you get when creating the sale order.By executing code, the Quotation convert into sale order.
You may refer the answer given by Nilesh Sheliya in (Stack overflow . com) for more details for the same query.

Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
0
jun. 21
3251
3
jul. 24
2412
1
nov. 18
3306
2
nov. 16
3099
0
abr. 24
1180