From 7c6292f91e1769a14f77c70c863e80172a85327b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Tue, 12 Nov 2013 15:04:57 +0100 Subject: [PATCH 1/3] [FIX] point_of_sale: make the web printed receipt fit on 80mm paper bzr revid: fva@openerp.com-20131112140457-sfmbu0ujz8lwfiil --- addons/point_of_sale/static/src/css/pos.css | 14 ++++++++++---- addons/point_of_sale/static/src/xml/pos.xml | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) 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/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 @@
-


From 2c5632271f41045462cd3d2e39956c747162e3c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Tue, 12 Nov 2013 16:10:41 +0100 Subject: [PATCH 2/3] [IMP] point_of_sale: only open cashbox when paying with cash + add manual override bzr revid: fva@openerp.com-20131112151041-3betwjahh9ph9vx5 --- .../static/src/img/open-cashbox.png | Bin 0 -> 1468 bytes addons/point_of_sale/static/src/js/screens.js | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 addons/point_of_sale/static/src/img/open-cashbox.png 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 0000000000000000000000000000000000000000..1e07b0a92825aa18f14f899b0e28b586a1ba7ef3 GIT binary patch literal 1468 zcmV;t1w;CYP)jP3kV`wqKgm*Eq#x#l&9*yx4{|)&Yd^7rF z3i<-ICPG3)tiB>N5hQ8igON>3ckk_;nR9%Yxp(iDrQO2T7x!dOX6D}AyWcn8IcH`r zFtC9QY+wT$*uVz%|247OA1p0hJ;Rb00Yp#x4l_T|?|uyc7($4aCG*zY+w(W~l)%!` z)iWv#ug%V!s#VHW2mwF{2nhI3;js*lFYhxmz=b{-%nY5TxV`*yb5qA>cS}M%3-~Y$ zVT^&4(z%d%U-&T*IcLiIocC?V^>V2UX2$L1Tg^1yJUchnI|;EH@G~c8YJm!n8tp*~ z2;l$=*;XP~fZa?p6POvq1SSG8Zy`jeR4O21{IYzj8E?jC=jYD#L?Y63sbt5Rv6IPO2{03^ zwH?=^D0;40KYH|No6y*3_Gh~y5cE!fVXf&3J`98BBC)cvg3+-t7^8hf>azmG3?^4O zhKGlrd*-{57#gZUYvUKcJy0O4*`Hm!i1X(^gf_bG8?(mRKbV*}ymuiqJUoi2V<#|m z>_p$ew^~j7@Z+Liq4$IU;r@d^@cQ&g5D|mrF)}g&Fn4SZlvI#PLP-T?pwVbR)$2|H zsbGzT)+vlNh?B&v#C=pi0?0RGNgTWVOBNo5@OkjyK5ksUj){p0jK6RQmMo-H2&96P z6057LSY2JkG06zKnQ*3S~T_3u!@i?#ZZss-8)F}`KA>ueGZXSmKv;d^rkqCAI z4`76uA*DbP$KXN|XNhX9MJsON`=x96{q7wkNp}Ka7~uHSap+Wc%)U-jD5a3Zago4C z;ipd}5p1JO1;Bm)Bdc1fJoGGndf%ik`DI8MOKh^jSMvhBk<03`*a zQ2tOaprpzV_)7ecYCPM;=kh0r3U~U zD3{Ae-hJ<#FZTLH)s=ZEe+qO}rAOkPAJ%R*_rC^t|=%lTo3i?aF8`?}h$L;7=nmuz?M1U;`UiSNj*f W^YttEX?`OB0000= literal 0 HcmV?d00001 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(); }, From ddf6ec224fed7c305b99fa04ff75ad70343a746d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Tue, 12 Nov 2013 17:05:34 +0100 Subject: [PATCH 3/3] [IMP] point_of_sale: improve the reactivity of the searchbox by timeouting on the search instead on searching after each character change bzr revid: fva@openerp.com-20131112160534-004d8df6ede1b4yt --- addons/point_of_sale/static/src/js/widgets.js | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) 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