[IMP] pos_restaurant: table notifications when there are unsent kitchen orders
This commit is contained in:
committed by
Frédéric van der Essen
parent
e2125f148d
commit
96e4fe2b22
@@ -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 ------- */
|
||||
|
||||
@@ -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)); });
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<t t-if='!widget.selected'>
|
||||
<div class='table' t-att-style='widget.table_style_str()'>
|
||||
<t t-if='widget.order_count'>
|
||||
<span class='order-count'><t t-esc='widget.order_count'/></span>
|
||||
<span t-att-class='"order-count " + (widget.notifications.printing ? "notify-printing":"")'><t t-esc='widget.order_count'/></span>
|
||||
</t>
|
||||
<span class='label'>
|
||||
<t t-esc='widget.table.name' />
|
||||
|
||||
Reference in New Issue
Block a user