[IMP] point_of_sale: fixes and performances optimisations

bzr revid: fva@openerp.com-20131112161433-8qxgklhrp6o2pmfj
This commit is contained in:
Frédéric van der Essen
2013-11-12 17:14:33 +01:00
5 changed files with 44 additions and 21 deletions
+10 -4
View File
@@ -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;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

+13 -2
View File
@@ -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();
},
+20 -14
View File
@@ -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
+1 -1
View File
@@ -585,7 +585,7 @@
<t t-name="PosTicket">
<div class="pos-sale-ticket">
<div class="pos-right-align"><t t-esc="new Date().toString(Date.CultureInfo.formatPatterns.shortDate + ' ' +
<div class="pos-center-align"><t t-esc="new Date().toString(Date.CultureInfo.formatPatterns.shortDate + ' ' +
Date.CultureInfo.formatPatterns.longTime)"/> <t t-esc="widget.currentOrder.attributes.name"/></div>
<br />
<t t-esc="widget.company.name"/><br />