[IMP] point_of_sale: more css adaptations for iPad / android + a few bug correction along the way

bzr revid: fva@openerp.com-20131106161723-vus7amgc6cfw3bzr
This commit is contained in:
Frédéric van der Essen 2013-11-06 17:17:23 +01:00
parent 6582780d3b
commit 7f0e721cc1
10 changed files with 131 additions and 48 deletions

View File

@ -64,6 +64,7 @@ class pos_config(osv.osv):
'iface_vkeyboard' : fields.boolean('Virtual KeyBoard Interface'),
'iface_print_via_proxy' : fields.boolean('Print via Proxy'),
'iface_invoicing': fields.boolean('Invoicing',help='Enables invoice generation from the Point of Sale'),
'iface_big_scrollbars': fields.boolean('Large Scrollbars',help='For imprecise industrial touchscreens'),
'state' : fields.selection(POS_CONFIG_STATE, 'Status', required=True, readonly=True),
'sequence_id' : fields.many2one('ir.sequence', 'Order IDs Sequence', readonly=True,

View File

@ -796,6 +796,7 @@
<field name="iface_electronic_scale" />
<field name="iface_vkeyboard" />
<field name="iface_print_via_proxy" />
<field name="iface_big_scrollbars" />
</group>
</group>
</sheet>

View File

@ -28,7 +28,6 @@
background-color: #DDD;
font-size: 12px;
line-height:40px;
border: 1px solid #CCC;
-webkit-border-radius: 5px;
position:absolute;
top:0;
@ -41,13 +40,14 @@
background-color: #fff;
border: 1px solid #f0f0f0;
top:0;
cursor: pointer;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-webkit-transition-property: top, background-color;
-webkit-transition-duration: 0.2s;
-webkit-transition-timing-function: linear;
}
.pos .keyboard li:hover {
.pos .keyboard li:active{
position: relative;
top: 2px;
left: 0px;

View File

@ -217,6 +217,7 @@
margin-right:0px;
border: 1px solid #353A7E;
background: #7f82ac;
text-shadow: none;
}
.pos .pos-rightheader button.square{
@ -410,7 +411,7 @@
width:100%;
height:100%;
overflow: hidden;
overflow-y: scroll;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
@ -598,6 +599,7 @@
line-height: 13px;
background: #7f82ac;
padding: 2px 5px;
border-radius: 2px;
}
.pos .product .product-name {
@ -633,6 +635,7 @@
bottom:0px;
width:100%;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
.pos .screen header h2 {
margin-top: 0px;
@ -646,8 +649,6 @@
margin-left: auto;
margin-right: auto;
margin-top: 50px;
padding: 40px;
background-color: #f8f8f8;
text-align: center;
}
.pos .dialog p{
@ -828,14 +829,11 @@
.pos .scale-screen .display{
position:relative;
width:600px;
width: 550px;
height:190px;
margin-top: 100px;
margin-left: auto;
margin-right: auto;
padding: 40px;
background: #f1f1f1;
border-top: 1px solid #efefef;
}
.pos .scale-screen .product-picture {
@ -854,11 +852,13 @@
background:#fff;
border: 1px solid #fff;
border-radius: 3px;
box-shadow: 0px 2px rgb(228, 228, 228);
}
.pos .scale-screen .product-picture img{
max-width: 178px;
max-height:178px;
max-width: 178px;
max-height: 178px;
vertical-align: middle;
cursor:pointer;
}
@ -872,40 +872,43 @@
line-height:1;
color:white;
background: #7f82ac;
padding: 2px 5px;
padding: 4px 5px;
border-radius: 3px;
cursor:pointer;
}
.pos .scale-screen .product-name {
position: absolute;
left:40px;
top:50px;
height:50px;
font-size:36px;
line-height:50px;
text-align:right;
right:275px;
left: 0px;
right: 210px;
top: 10px;
height: 50px;
font-size: 36px;
line-height: 50px;
text-align: right;
color: #8d8d8d;
overflow: hidden;
text-overflow: ellipsis;
}
.pos .scale-screen .weight{
position: absolute;
left: 40px;
height: 90px;
bottom: 55px;
right: 260px;
padding: 6px;
padding-right: 33px;
padding-top: 11px;
background: white;
position: absolute;
left: 0;
top: 80px;
height: 90px;
bottom: 55px;
right: 210px;
padding: 6px;
padding-right: 33px;
padding-top: 11px;
background: white;
border-radius: 3px;
box-shadow: 0px 2px rgb(228, 228, 228) inset;
}
.pos .scale-screen .weight p{
display: inline-block;
text-align:right;
line-height: 90px;
font-size: 70px;
font-size: 56px;
width: 100%;
height: 100%;
margin: 0;
@ -930,6 +933,8 @@
font-weight:bold;
background-color: #F0EEEE;
border: 1px solid #E0DDDD;
border-radius: 3px;
box-shadow: 0px 10px 20px rgba(0,0,0,0.4);
z-index:1150;
}
@ -947,7 +952,7 @@
width:100%;
height:100%;
overflow:hidden;
overflow-y: scroll;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
@ -989,7 +994,7 @@
border-color:#777;
}
.pos .order .summary .line .subentry{
font-size: 10px;
font-size: 14px;
font-weight: normal;
text-align: center;
}
@ -1112,6 +1117,9 @@
-webkit-transition-timing-function: ease-out;
}
.pos .pos-actionbar .button.disabled{
opacity: 0.5;
}
.pos .pos-actionbar .button.disabled:active{
border: 1px solid #cacaca;
color: #555;
@ -1220,6 +1228,8 @@
font-size:20px;
font-weight:bold;
background-color: #F0EEEE;
border-radius: 3px;
box-shadow: 0px 10px 20px rgba(0,0,0,0.4);
z-index:1200;
}
.pos .popup .footer{
@ -1292,6 +1302,34 @@
min-height: 30px;
}
.pos.big-scrollbars *::-webkit-scrollbar{
width: 40px;
height: 40px;
}
.pos.big-scrollbars *::-webkit-scrollbar-track{
background: rgb(224,224,224);
border-left: none;
}
.pos.big-scrollbars *::-webkit-scrollbar-thumb{
background: rgb(168,168,168);
min-height: 40px;
border-radius: 3px;
}
.pos.big-scrollbars *::-webkit-scrollbar-button{
width: 40px;
height: 40px;
border-radius: 3px;
background: rgb(210,210,210);
background-size: cover;
}
.pos.big-scrollbars *::-webkit-scrollbar-button:decrement{
background-image: url('../img/scroll-up.png');
}
.pos.big-scrollbars *::-webkit-scrollbar-button:increment{
background-image: url('../img/scroll-down.png');
}
/* ********* Unsupported Browser Page ********* */
.pos .not-supported-browser{

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

View File

@ -152,7 +152,8 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
['name','journal_ids','warehouse_id','journal_id','pricelist_id',
'iface_self_checkout', 'iface_led', 'iface_cashdrawer',
'iface_payment_terminal', 'iface_electronic_scale', 'iface_barscan', 'iface_vkeyboard',
'iface_print_via_proxy','iface_cashdrawer','iface_invoicing','state','sequence_id','session_ids'],
'iface_print_via_proxy','iface_cashdrawer','iface_invoicing','iface_big_scrollbars',
'state','sequence_id','session_ids'],
[['id','=', self.get('pos_session').config_id[0]]]
);
}).then(function(configs){
@ -164,6 +165,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
self.iface_self_checkout = !!pos_config.iface_self_checkout;
self.iface_cashdrawer = !!pos_config.iface_cashdrawer;
self.iface_invoicing = !!pos_config.iface_invoicing;
self.iface_big_scrollbars = !!pos_config.iface_big_scrollbars;
return self.fetch('stock.warehouse',[],[['id','=',pos_config.warehouse_id[0]]]);
}).then(function(shops){

View File

@ -495,6 +495,17 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
this.set_weight(0);
this.renderElement();
this.hotkey_handler = function(event){
if(event.which === 13){
self.order_product();
self.pos_widget.screen_selector.set_current_screen(self.next_screen);
}else if(event.which === 27){
self.pos_widget.screen_selector.set_current_screen(self.previous_screen);
}
};
$('body').on('keyup',this.hotkey_handler);
this.add_action_button({
label: _t('Back'),
icon: '/point_of_sale/static/src/img/icons/png48/go-previous.png',
@ -560,6 +571,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
close: function(){
var self = this;
this._super();
$('body').off('keyup',this.hotkey_handler);
this.pos.proxy_queue.clear();
this.pos.proxy_queue.schedule(function(){
@ -662,6 +674,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
icon: '/point_of_sale/static/src/img/icons/png48/go-previous.png',
click: function(){
self.queue.schedule(self.cancel);
self.pos_widget.screen_selector.set_current_screen(self.previous_screen);
}
});
},
@ -681,6 +694,13 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
show_numpad: false,
show_leftpane: false,
start: function(){
this._super();
$('.goodbye-message').click(function(){
$(this).addClass('oe_hidden');
});
},
barcode_product_action: function(code){
this.pos.proxy.transaction_start();
this._super(code);
@ -871,6 +891,17 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
this._super();
var self = this;
this.hotkey_handler = function(event){
if(event.which === 13){
self.validateCurrentOrder();
}else if(event.which === 27){
self.back();
}
};
$('body').on('keyup',this.hotkey_handler);
if(this.pos.iface_cashdrawer){
this.pos.proxy.open_cashbox();
}
@ -881,12 +912,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
label: _t('Back'),
icon: '/point_of_sale/static/src/img/icons/png48/go-previous.png',
click: function(){
_.each(self.paymentlinewidgets, function(widget){
if( widget.payment_line.get_amount() === 0 ){
widget.payment_line.destroy();
}
});
self.pos_widget.screen_selector.set_current_screen(self.back_screen);
self.back();
},
});
@ -917,9 +943,15 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
this._super();
this.pos_widget.order_widget.set_numpad_state(null);
this.pos_widget.payment_screen.set_numpad_state(null);
$('body').off('keyup',this.hotkey_handler);
},
back: function() {
this.pos_widget.screen_selector.set_current_screen(self.back_screen);
_.each(this.paymentlinewidgets, function(widget){
if( widget.payment_line.get_amount() === 0 ){
widget.payment_line.destroy();
}
});
this.pos_widget.screen_selector.set_current_screen(this.back_screen);
},
validateCurrentOrder: function(options) {
var self = this;
@ -927,6 +959,9 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
var currentOrder = this.pos.get('selectedOrder');
if(currentOrder.getPaidTotal() + 0.000001 < currentOrder.getTotalTaxIncluded()){
return;
}
if(options.invoice){
// deactivate the validation button while we try to send the order

View File

@ -70,21 +70,24 @@ function openerp_pos_keyboard(instance, module){ //module is instance.point_of_s
// Clears the content of the input zone.
deleteAllCharacters: function(){
var $input = this.$target;
$input[0].value = "";
$input.keydown();
$input.keyup();
if($input[0].value){
$input[0].value = "";
$input.keydown();
$input.keyup();
}
},
// Makes the keyboard show and slide from the bottom of the screen.
show: function(){
$('.keyboard_frame').show().animate({'height':'235px'}, 500, 'swing');
$('.keyboard_frame').show().css({'height':'235px'});
},
// Makes the keyboard hide by sliding to the bottom of the screen.
hide: function(){
var self = this;
var frame = $('.keyboard_frame');
frame.animate({'height':'0'}, 500, 'swing', function(){ frame.hide(); self.reset(); });
$('.keyboard_frame')
.css({'height':'0'})
.hide();
this.reset();
},
//What happens when the shift key is pressed : toggle case, remove capslock

View File

@ -546,7 +546,6 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
// 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){
@ -842,6 +841,10 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
self.build_widgets();
if(self.pos.iface_big_scrollbars){
self.$el.addClass('big-scrollbars');
}
self.screen_selector.set_default_screen();