[FIX] point_of_sale: prevent from spinner to appear when we have a rpc timeout, and try to flush saved orders after loading

bzr revid: fva@openerp.com-20130327125541-pbqkn764h6fngf33
This commit is contained in:
Frédéric van der Essen
2013-03-27 13:55:41 +01:00
parent e985ddea30
commit 72dbae9ddf
2 changed files with 4 additions and 1 deletions
+2 -1
View File
@@ -295,7 +295,8 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
return;
}
//try to push an order to the server
(new instance.web.Model('pos.order')).get_func('create_from_ui')([order])
// shadow : true is to prevent a spinner to appear in case of timeout
(new instance.web.Model('pos.order')).call('create_from_ui',[[order]],undefined,{ shadow:true })
.fail(function(unused, event){
//don't show error popup if it fails
event.preventDefault();
@@ -879,6 +879,8 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
instance.web.unblockUI();
self.$('.loader').animate({opacity:0},1500,'swing',function(){self.$('.loader').hide();});
self.pos.flush();
}).fail(function(){ // error when loading models data from the backend
instance.web.unblockUI();
return new instance.web.Model("ir.model.data").get_func("search_read")([['name', '=', 'action_pos_session_opening']], ['res_id'])