Odoo-14: How to add orderline in current POS order

636 views Asked by At

I need to append a "specific" product in current order's orderline on the the click on particular button, same functionality needs to be used i.e. when you click on any product and it gets added to orderline. With following line of code, unable to get order id:

this.env.pos.get_order()

I am unable to get in-process order id as it is not yet created in backend until its paid.

1

There are 1 answers

1
Satya Dev Yadav On BEST ANSWER

To get the order and add a new orderline you can use

var order = this.env.pos.get_order();
order.add_product(product, { quantity: 1, price: total_price });