From db172f25316c66d83a1db0cd45bb9618968c85be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Fri, 13 Jul 2012 17:37:19 +0200 Subject: [PATCH] [FIX] point_of_sale: close button doesn't crash anymore bzr revid: fva@openerp.com-20120713153719-256zclhnwzvq52qf --- addons/account/account_view.xml | 13 +++++---- .../static/src/js/pos_widgets.js | 28 +------------------ 2 files changed, 9 insertions(+), 32 deletions(-) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index dc9ea8a439c..18f8a0ad39c 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -506,11 +506,14 @@ - - - - - + + + + + + + + diff --git a/addons/point_of_sale/static/src/js/pos_widgets.js b/addons/point_of_sale/static/src/js/pos_widgets.js index c4e71411757..8ec2d9c329c 100644 --- a/addons/point_of_sale/static/src/js/pos_widgets.js +++ b/addons/point_of_sale/static/src/js/pos_widgets.js @@ -871,32 +871,6 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa var self = this; self.pos.flush().then(function() { self.close(); - /* - if (self.pos.get('nbr_pending_operations').length > 0) { - var confirm = false; - $(QWeb.render('PosCloseWarning')).dialog({ - resizable: false, - height:160, - modal: true, - title: "Warning", - buttons: { - "Yes": function() { - confirm = true; - $( this ).dialog( "close" ); - }, - "No": function() { - $( this ).dialog( "close" ); - } - }, - close: function() { - if (confirm){ - close(); - } - } - }); - } else { - close(); - }*/ }); }, close: function() { @@ -905,7 +879,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa _.bind(function(res) { return this.rpc('/web/action/load', {'action_id': res[0]['res_id']}).pipe(_.bind(function(result) { var action = result.result; - action.context = _.extend(action.context || {}, {'cancel_action': {type: 'ir.actions.client', tag: 'default_home'}}); + action.context = _.extend(action.context || {}, {'cancel_action': {type: 'ir.actions.client', tag: 'reload'}}); this.do_action(action); }, this)); }, this));