diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index b5792f0124d..49521377ccb 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -311,7 +311,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal module.Product = Backbone.Model.extend({ get_image_url: function(){ - return '/web/binary/image?session_id='instance.session.session_id+'&model=product.product&field=image&id='+this.get('id'); + return '/web/binary/image?session_id='+instance.session.session_id+'&model=product.product&field=image&id='+this.get('id'); }, }); diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 2ead7333bed..3b580868e6b 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -65,6 +65,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa }, close_popup: function(){ if(this.current_popup){ + this.current_popup.close(); this.current_popup.hide(); this.current_popup = null; } @@ -336,6 +337,11 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa this.$el.show(); } }, + /* called before hide, when a popup is closed */ + close: function(){ + }, + /* hides the popup. keep in mind that this is called in the initialization pass of the + * pos instantiation, so you don't want to do anything fancy in here */ hide: function(){ if(this.$el){ this.$el.hide(); @@ -352,9 +358,11 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa this.$el.find('.button').off('click').click(function(){ self.pos_widget.screen_selector.close_popup(); - self.pos.proxy.help_canceled(); }); }, + close:function(){ + this.pos.proxy.help_canceled(); + }, }); module.ChooseReceiptPopupWidget = module.PopUpWidget.extend({