diff options
| author | Darshan Kalola <dka@openerp.com> | 2016-01-05 16:40:17 +0530 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2016-05-13 09:43:04 +0200 |
| commit | 34643da75d7aaabdff5bccb8185ccee8bd339165 (patch) | |
| tree | 05de15af0cf4775cacb9f7a0666039a15210ed7e /addons | |
| parent | c5a632a2fcd494547a144a8b68eab0a8276347a9 (diff) | |
[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).
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/pos_restaurant/static/src/js/floors.js | 11 | ||||
| -rw-r--r-- | 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 <i class="fa fa-plus"></i> button in the editing toolbar to create new tables. </div> <div class='tables'></div> - <span class='edit-button editing'><i class='fa fa-pencil'></i></span> + <span t-if="widget.pos.user.role == 'manager'" class='edit-button editing'><i class='fa fa-pencil'></i></span> <div class='edit-bar oe_hidden'> <span class='edit-button new-table'> <i class='fa fa-plus'></i> |
