[FIX] point_of_sale: the order should not be displayed in the print screen, and the...
authorFrederic van der Essen <fva@openerp.com / fvdessen+o@gmail.com>
Wed, 5 Nov 2014 19:02:49 +0000 (20:02 +0100)
committerFrederic van der Essen <fva@openerp.com / fvdessen+o@gmail.com>
Wed, 5 Nov 2014 19:02:49 +0000 (20:02 +0100)
addons/point_of_sale/static/src/js/screens.js

index 63caa5f..3a09233 100644 (file)
@@ -919,8 +919,8 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
     module.ReceiptScreenWidget = module.ScreenWidget.extend({
         template: 'ReceiptScreenWidget',
 
-        show_numpad:     true,
-        show_leftpane:   true,
+        show_numpad:     false,
+        show_leftpane:   false,
 
         show: function(){
             this._super();
@@ -939,7 +939,10 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
                 });
 
             this.refresh();
-            this.print();
+
+            if (!this.pos.get('selectedOrder')._printed) {
+                this.print();
+            }
 
             //
             // The problem is that in chrome the print() is asynchronous and doesn't
@@ -964,6 +967,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
             }, 2000);
         },
         print: function() {
+            this.pos.get('selectedOrder')._printed = true;
             window.print();
         },
         finishOrder: function() {