Skip to content
Snippets Groups Projects
Commit 89e17997 authored by Frédéric van der Essen's avatar Frédéric van der Essen
Browse files

[FIX] point_of_sale: flush orders before closing the pos. This will help...

[FIX] point_of_sale: flush orders before closing the pos. This will help prevent users from closing the session with unflushed orders
parent a11b530b
No related branches found
No related tags found
No related merge requests found
......@@ -1231,8 +1231,10 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
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'];
});
});
}
......@@ -1241,10 +1243,10 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
});
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() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment