Odoo Help

2

0
1 Answer
0
Avatar

Tintuk Tomin India

--Tintuk Tomin--

922
| 2 2 4
MUTTOM THODUPUZHA, India
--Tintuk Tomin--
Tintuk Tomin India
9/28/18, 3:07 AM

The below code is enough for clear a single line.

var OrderLineClear = screens.ActionButtonWidget.extend({
template: "OrderLineClear",

button_click: function(){
var self = this;
this.clear_button_fun();
},

clear_button_fun(){
var order = this.pos.get_order();
order.remove_orderline(order.get_selected_orderline())
},
});
screens.define_action_button({'name': 'clear_button_fun','widget': OrderLineClear,});

If you want to change it to clear all the cart the code will be,


var order = this.pos.get_order();

for (var lines in order.get_orderlines()){
    order.remove_orderline(order.get_orderlines());



Ask a Question
Writer
Keep Informed
1 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now