X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=addons%2Fpoint_of_sale%2Fstatic%2Fsrc%2Fjs%2Fwidgets.js;h=c7874a4bd5c4df9058485d678c293e7041070295;hb=c196424dca20493468aaba6da09fb0e1abdcdd1f;hp=ed9b1fd060aba3c8286cc4d6324aded6b00aa659;hpb=d37a79d0da41c4dd9e537bf18f2aa8ee19c95325;p=odoo%2Fodoo.git diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js index ed9b1fd..c7874a4 100644 --- a/addons/point_of_sale/static/src/js/widgets.js +++ b/addons/point_of_sale/static/src/js/widgets.js @@ -315,7 +315,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa this._super(); this.$('input').keyup(_.bind(this.changeAmount, this)); this.$('.delete-payment-line').click(function() { - self.trigger('delete_payment_line'); + self.trigger('delete_payment_line', self); }); }, }); @@ -806,7 +806,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa start: function() { var self = this; - return self.pos.ready.then(function() { + return self.pos.ready.done(function() { self.build_currency_template(); self.renderElement(); @@ -845,7 +845,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa self.$('.loader').animate({opacity:0},1500,'swing',function(){self.$('.loader').hide();}); self.$('.loader img').hide(); - },function(){ // error when loading models data from the backend + }).fail(function(){ // error when loading models data from the backend self.$('.loader img').hide(); return new instance.web.Model("ir.model.data").get_func("search_read")([['name', '=', 'action_pos_session_opening']], ['res_id']) .pipe( _.bind(function(res){ @@ -1051,7 +1051,8 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa this.pos.barcode_reader.disconnect(); return new instance.web.Model("ir.model.data").get_func("search_read")([['name', '=', 'action_client_pos_menu']], ['res_id']).pipe( _.bind(function(res) { - return this.rpc('/web/action/load', {'action_id': res[0]['res_id']}).pipe(_.bind(function(action) { + return this.rpc('/web/action/load', {'action_id': res[0]['res_id']}).pipe(_.bind(function(result) { + var action = result; action.context = _.extend(action.context || {}, {'cancel_action': {type: 'ir.actions.client', tag: 'reload'}}); //self.destroy(); this.do_action(action);