From 96e4fe2b227047740db3b7b5b3d32603ede867cb Mon Sep 17 00:00:00 2001 From: Frederic van der Essen Date: Tue, 30 Sep 2014 21:07:06 +0200 Subject: [PATCH] [IMP] pos_restaurant: table notifications when there are unsent kitchen orders --- addons/pos_restaurant/static/src/css/restaurant.css | 3 +++ addons/pos_restaurant/static/src/js/floors.js | 13 ++++++++++++- addons/pos_restaurant/static/src/js/main.js | 3 +-- addons/pos_restaurant/static/src/xml/floors.xml | 2 +- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/addons/pos_restaurant/static/src/css/restaurant.css b/addons/pos_restaurant/static/src/css/restaurant.css index 962c3668957..20e1fb88149 100644 --- a/addons/pos_restaurant/static/src/css/restaurant.css +++ b/addons/pos_restaurant/static/src/css/restaurant.css @@ -193,6 +193,9 @@ border-radius: 10px; font-size: 16px; } +.floor-map .table .order-count.notify-printing { + background: red; +} /* ------ FLOOR BUTTON IN THE ORDER SELECTOR ------- */ diff --git a/addons/pos_restaurant/static/src/js/floors.js b/addons/pos_restaurant/static/src/js/floors.js index e563fb8a37f..b48cdd0fad0 100644 --- a/addons/pos_restaurant/static/src/js/floors.js +++ b/addons/pos_restaurant/static/src/js/floors.js @@ -74,7 +74,6 @@ function openerp_restaurant_floors(instance,module){ } },50); } else { - console.log('set table',this.table); floorplan.pos.set_table(this.table); } }, @@ -265,9 +264,21 @@ function openerp_restaurant_floors(instance,module){ self.destroy(); }); }, + get_notifications: function(){ //FIXME : Make this faster + var orders = this.pos.get_table_orders(this.table); + var notifications = {}; + for (var i = 0; i < orders.length; i++) { + if (orders[i].hasChangesToPrint()) { + notifications['printing'] = true; + break; + } + } + return notifications + }, renderElement: function(){ var self = this; this.order_count = this.pos.get_table_orders(this.table).length; + this.notifications = this.get_notifications(); this._super(); this.$el.on('mouseup', function(event){ self.click_handler(event,$(this)); }); diff --git a/addons/pos_restaurant/static/src/js/main.js b/addons/pos_restaurant/static/src/js/main.js index 6967ba9e95c..eaafccdf114 100644 --- a/addons/pos_restaurant/static/src/js/main.js +++ b/addons/pos_restaurant/static/src/js/main.js @@ -2,12 +2,11 @@ openerp.pos_restaurant = function(instance){ var module = instance.point_of_sale; - openerp_restaurant_multiprint(instance,module); - openerp_restaurant_splitbill(instance,module); openerp_restaurant_printbill(instance,module); openerp_restaurant_floors(instance,module); + openerp_restaurant_multiprint(instance,module); }; diff --git a/addons/pos_restaurant/static/src/xml/floors.xml b/addons/pos_restaurant/static/src/xml/floors.xml index 16efe1f1aa7..0a79f0a44f1 100644 --- a/addons/pos_restaurant/static/src/xml/floors.xml +++ b/addons/pos_restaurant/static/src/xml/floors.xml @@ -5,7 +5,7 @@
- +