diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index da8325cd046..89ab429c4f4 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -97,6 +97,9 @@ .point-of-sale .pos-right-align { text-align: right; } +.point-of-sale .pos-center-align { + text-align: center; +} .point-of-sale .pos-right-align input { text-align: right; border: 1px solid #cecbcb; @@ -815,6 +818,9 @@ } @media print { + .point-of-sale{ + background: white !important; + } .point-of-sale #topheader, .point-of-sale #leftpane { display: none !important; } @@ -834,9 +840,6 @@ .pos-actionbar { display: none !important; } - .pos-sale-ticket { - margin: 0; - } .debug-widget{ display: none !important; } @@ -846,9 +849,12 @@ background: transparent !important; } .point-of-sale .pos-sale-ticket{ + margin: 0; margin-left: auto !important; margin-right: auto !important; - border: solid 1px black !important; + border: none !important; + font-size: 13px !important; + width: 266px !important; } } diff --git a/addons/point_of_sale/static/src/img/open-cashbox.png b/addons/point_of_sale/static/src/img/open-cashbox.png new file mode 100644 index 00000000000..1e07b0a9282 Binary files /dev/null and b/addons/point_of_sale/static/src/img/open-cashbox.png differ diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 77a542ff93c..01ccd538d8c 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -873,8 +873,8 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa this._super(); var self = this; - if(this.pos.iface_cashdrawer){ - this.pos.proxy.open_cashbox(); + if( this.pos.iface_cashdrawer && this.pos.get('selectedOrder').get('paymentLines').find( function(pl){ return pl.cashregister.get('journal').type === 'cash'; })){ + this.pos.proxy.open_cashbox(); } this.set_numpad_state(this.pos_widget.numpad.state); @@ -912,6 +912,17 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa }); } + if( this.pos.iface_cashdrawer ){ + this.add_action_button({ + label: _t('Cash'), + name: 'cashbox', + icon: '/point_of_sale/static/src/img/open-cashbox.png', + click: function(){ + self.pos.proxy.open_cashbox(); + }, + }); + } + this.updatePaymentSummary(); this.line_refocus(); }, diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js index 447094e0c4e..866e3c7ba72 100644 --- a/addons/point_of_sale/static/src/js/widgets.js +++ b/addons/point_of_sale/static/src/js/widgets.js @@ -560,26 +560,32 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa var products = this.pos.db.get_product_by_category(this.category.id); self.pos.get('products').reset(products); + + var searchtimeout = null; // filter the products according to the search string this.$('.searchbox input').keyup(function(event){ - console.log('event',event); - query = $(this).val().toLowerCase(); - if(query){ - if(event.which === 13){ - if( self.pos.get('products').size() === 1 ){ - self.pos.get('selectedOrder').addProduct(self.pos.get('products').at(0)); - self.clear_search(); + clearTimeout(searchtimeout); + + var query = $(this).val().toLowerCase(); + + searchtimeout = setTimeout(function(){ + if(query){ + if(event.which === 13){ + if( self.pos.get('products').size() === 1 ){ + self.pos.get('selectedOrder').addProduct(self.pos.get('products').at(0)); + self.clear_search(); + } + }else{ + var products = self.pos.db.search_product_in_category(self.category.id, query); + self.pos.get('products').reset(products); + self.$('.search-clear').fadeIn(); } }else{ - var products = self.pos.db.search_product_in_category(self.category.id, query); + var products = self.pos.db.get_product_by_category(self.category.id); self.pos.get('products').reset(products); - self.$('.search-clear').fadeIn(); + self.$('.search-clear').fadeOut(); } - }else{ - var products = self.pos.db.get_product_by_category(self.category.id); - self.pos.get('products').reset(products); - self.$('.search-clear').fadeOut(); - } + },200); }); //reset the search when clicking on reset diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index d5f57e099f7..742c823702e 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -585,7 +585,7 @@
-