From d30dc934f6a3a598ac0958fdba965d2c55514beb Mon Sep 17 00:00:00 2001 From: Frederic van der Essen Date: Tue, 29 Jul 2014 15:29:28 +0200 Subject: [PATCH] [IMP] restaurant: discard kitchen order changes when splitting the bill. --- addons/restaurant/static/src/js/splitbill.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/addons/restaurant/static/src/js/splitbill.js b/addons/restaurant/static/src/js/splitbill.js index dd90d159af5..81591ccc589 100644 --- a/addons/restaurant/static/src/js/splitbill.js +++ b/addons/restaurant/static/src/js/splitbill.js @@ -122,6 +122,19 @@ function openerp_restaurant_splitbill(instance, module){ } neworder.addPaymentline(cashregister); neworder.set_screen_data('screen','payment'); + + // for the kitchen printer we assume that everything + // has already been sent to the kitchen before splitting + // the bill. So we save all changes both for the old + // order and for the new one. This is not entirely correct + // but avoids flooding the kitchen with unnecessary orders. + // Not sure what to do in this case. + + if ( neworder.saveChanges ) { + order.saveChanges(); + neworder.saveChanges(); + } + this.pos.get('orders').add(neworder); this.pos.set('selectedOrder',neworder); }