Skip to Content
Menu
This question has been flagged

I want to create an order using odoo-xml-rpc using node js. Write now i created order first and then I am creating the order item as mentioned in the following url :- https://stackoverflow.com/a/40595869/363661 .

odoo.execute_kw('pos.order', 'create', params, function (err, value) { //first creating order
    if (err) { return console.log(err); }
    console.log(value)
        var inParams = [];
        inParams.push({
            'order_id' : value //passing previous executed order_id to order item
    })
        var params = [];
        params.push(inParams);
        odoo.execute_kw('pos.order.line', 'create', params, function (err, value) { // then create order item with that order id
            if (err) { return console.log(err); }
            res.send('order item created')
        });

});

The logic here is first we create an order and pass that order id to the line item creating api. But the problem here is "amount_total" is mandatory when creating order and after attaching order id to order item the order amount is not updating . How can we manage order subtotal using api? ( I am using nodejs xml-rpc)

Avatar
Discard
Related Posts Replies Views Activity
0
May 22
1216
3
Jan 24
11858
1
Jun 23
6739
3
Sep 22
28131
1
Mar 21
4459