var self = this;
function close(){
- return new instance.web.Model("ir.model.data").get_func("search_read")([['name', '=', 'action_client_pos_menu']], ['res_id']).pipe(function(res) {
- window.location = '/web#action=' + res[0]['res_id'];
+ self.pos.push_order().then(function(){
+ return new instance.web.Model("ir.model.data").get_func("search_read")([['name', '=', 'action_client_pos_menu']], ['res_id']).pipe(function(res) {
+ window.location = '/web#action=' + res[0]['res_id'];
+ });
});
}
});
if(draft_order){
if (confirm(_t("Pending orders will be lost.\nAre you sure you want to leave this session?"))) {
- return close();
+ close();
}
}else{
- return close();
+ close();
}
},
destroy: function() {