From 34643da75d7aaabdff5bccb8185ccee8bd339165 Mon Sep 17 00:00:00 2001 From: Darshan Kalola Date: Tue, 5 Jan 2016 16:40:17 +0530 Subject: [PATCH] [IMP] pos restaurant: prevent an offline table removal from floor screen - Current pos restaurant with offline mode, when you delete the table from floor screen, it would stop everything (you won't be able to create an order further) untill your server start again, that is not good indeed. Instead we should show the error popup, just like you will get when you click on '+' for adding a new table on offline mode. - Slightly improve the other relevant warning messages. - Only pos managers can edit the floor screen. Before this pos user were allowed to access the edit button (pencil icon on floor screen), but they could never update the table detail as lack of permission so in this we have prohibited the pos user from accessing an edit button(pencil icon). --- addons/pos_restaurant/static/src/js/floors.js | 11 +++++++++-- addons/pos_restaurant/static/src/xml/floors.xml | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/addons/pos_restaurant/static/src/js/floors.js b/addons/pos_restaurant/static/src/js/floors.js index c71342edb8e..f73998b37ed 100644 --- a/addons/pos_restaurant/static/src/js/floors.js +++ b/addons/pos_restaurant/static/src/js/floors.js @@ -258,7 +258,7 @@ var TableWidget = PosBaseWidget.extend({ }, function(err,event) { self.gui.show_popup('error',{ 'title':_t('Changes could not be saved'), - 'body': _t('Check your internet connection and access rights'), + 'body': _t('You must be connected to the internet to save your changes.'), }); event.stopPropagation(); event.preventDefault(); @@ -292,6 +292,13 @@ var TableWidget = PosBaseWidget.extend({ } floorplan.update_toolbar(); self.destroy(); + }, function(err, event) { + self.gui.show_popup('error', { + 'title':_t('Changes could not be saved'), + 'body': _t('You must be connected to the internet to save your changes.'), + }); + event.stopPropagation(); + event.preventDefault(); }); }, get_notifications: function(){ //FIXME : Make this faster @@ -402,7 +409,7 @@ var FloorScreenWidget = screens.ScreenWidget.extend({ .call('set_background_color',[this.floor.id, background]).fail(function(err,event){ self.gui.show_popup('error',{ 'title':_t('Changes could not be saved'), - 'body': _t('Check your internet connection and access rights'), + 'body': _t('You must be connected to the internet to save your changes.'), }); event.stopPropagation(); event.preventDefault(); diff --git a/addons/pos_restaurant/static/src/xml/floors.xml b/addons/pos_restaurant/static/src/xml/floors.xml index e2ca6bfb419..5e6e54d0c15 100644 --- a/addons/pos_restaurant/static/src/xml/floors.xml +++ b/addons/pos_restaurant/static/src/xml/floors.xml @@ -107,7 +107,7 @@ This floor has no tables yet, use the button in the editing toolbar to create new tables.
- +