[IMP] point_of_sale: some improvements to the debug window

bzr revid: fva@openerp.com-20120913104621-zryga82o3d4vq174
This commit is contained in:
Frédéric van der Essen 2012-09-13 12:46:21 +02:00
parent 9dfca35b19
commit b7d56a0b04
5 changed files with 27 additions and 22 deletions

View File

@ -1166,17 +1166,15 @@
cursor:default;
}
.point-of-sale .debug-widget .status.on{
padding: 5px;
padding-left: 15px;
display: block;
background-color: green;
}
.point-of-sale .debug-widget .status.on{
padding: 5px;
padding-left: 15px;
display: block;
background-color: #6cd11d;
}
.point-of-sale .debug-widget .event{
padding: 5px;
padding-left: 15px;
display: block;
cursor:default;
background-color: #1E1E1E;
}
/* ********* The PopupWidgets ********* */

View File

@ -21,6 +21,8 @@ function openerp_pos_db(instance, module){
this.category_childs = {};
this.category_parent = {};
this.category_search_string = {};
this.packagings_by_product_id = {};
this.packagings_by_product_id = {};
},
/* returns the category object from its id. If you pass a list of id as parameters, you get
* a list of category objects.
@ -158,6 +160,12 @@ function openerp_pos_db(instance, module){
this.save('products',stored_products);
this.save('categories',stored_categories);
},
add_packagings: function(packagings){
this.packagings_by_product_id
for(var i = 0, len = packagings.length; i < len; i++){
var pack = packagings[i];
}
},
/* removes all the data from the database. TODO : being able to selectively remove data */
clear: function(stores){
for(var i = 0, len = arguments.length; i < len; i++){

View File

@ -27,10 +27,6 @@ function openerp_pos_devices(instance,module){ //module is instance.point_of_sal
success_callback = success_callback || function(){};
error_callback = error_callback || function(){};
if(jQuery.deparam(jQuery.param.querystring()).debug !== undefined){
console.log('PROXY:',name,params);
}
var callbacks = this.notifications[name] || [];
for(var i = 0; i < callbacks.length; i++){
callbacks[i](params);

View File

@ -686,6 +686,8 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
'open_cashbox',
'print_receipt',
'print_pdf_invoice',
'weighting_read_kg',
'is_payment_accepted',
],
minimized: false,
start: function(){
@ -727,9 +729,8 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
});
_.each(this.events, function(name){
self.pos.proxy.add_notification(name,function(){
console.log('Notification:',name);
self.$('.status.'+name).stop().clearQueue().css({'background-color':'#6CD11D'});
self.$('.status.'+name).animate({'background-color':'black'},2000);
self.$('.event.'+name).stop().clearQueue().css({'background-color':'#6CD11D'});
self.$('.event.'+name).animate({'background-color':'#1E1E1E'},2000);
});
});
self.pos.proxy.add_notification('help_needed',function(){

View File

@ -452,12 +452,14 @@
</ul>
<p class="category">Hardware Events</p>
<ul>
<li class="status scan_item_success">Scan Item Success</li>
<li class="status scan_item_error_unrecognized">Scan Item Unrecognized</li>
<li class="status payment_request">Payment Request</li>
<li class="status open_cashbox">Open Cashbox</li>
<li class="status print_receipt">Print Receipt</li>
<li class="status print_pdf_invoice">Print Invoice</li>
<li class="event scan_item_success">Scan Item Success</li>
<li class="event scan_item_error_unrecognized">Scan Item Unrecognized</li>
<li class="event payment_request">Payment Request</li>
<li class="event open_cashbox">Open Cashbox</li>
<li class="event print_receipt">Print Receipt</li>
<li class="event print_pdf_invoice">Print Invoice</li>
<li class="event weighting_read_kg">Read Weighting Scale</li>
<li class="event is_payment_accepted">Check Payment</li>
</ul>
</div>
</div>