From c077cd7448edd17bb047819a2ea2d42b064e5694 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Tue, 13 Dec 2016 23:01:55 +0100 Subject: [PATCH] [FIX] point_of_sale: scroll to bottom after weighing product When switching back from the scale screen to the product screen, the order summary was re-drawn and always scrolled at the top. This happens because the redraw takes place in the background while the scale screen is still displayed, so the new area does not know its size yet and cannot be scrolled properly. Swapping these operations around fixes the issue and it happens fast enough to be invisible to the user. --- addons/point_of_sale/static/src/js/screens.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 51ed423bbaa..ebdf2ec5762 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -272,8 +272,9 @@ var ScaleScreenWidget = ScreenWidget.extend({ }); this.$('.next,.buy-product').click(function(){ - self.order_product(); self.gui.show_screen(self.next_screen); + // add product *after* switching screen to scroll properly + self.order_product(); }); queue.schedule(function(){