[FIX] point_of_sale: loading screen was not waiting until posbox connection
authorFrédéric van der Essen <fva@openerp.com>
Wed, 29 Jan 2014 13:57:10 +0000 (14:57 +0100)
committerFrédéric van der Essen <fva@openerp.com>
Wed, 29 Jan 2014 13:57:10 +0000 (14:57 +0100)
bzr revid: fva@openerp.com-20140129135710-vobqzjyq12d7io3v

addons/point_of_sale/static/src/js/models.js

index f623b21..d263135 100644 (file)
@@ -92,6 +92,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
         },
         connect_to_proxy: function(){
             var self = this;
+            var  done = new $.Deferred();
             this.barcode_reader.disconnect_from_proxy();
             this.pos_widget.loading_message(_t('Connecting to the PosBox'),0);
             this.pos_widget.loading_skip(function(){
@@ -106,7 +107,10 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
                     if(self.config.iface_scan_via_proxy){
                         self.barcode_reader.connect_to_proxy();
                     }
+                }).always(function(){
+                    done.resolve();
                 });
+            return done;
         },
 
         // helper function to load data from the server