From b7d56a0b043b7a9e6e1fcec49873d9574538d9a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Thu, 13 Sep 2012 12:46:21 +0200 Subject: [PATCH] [IMP] point_of_sale: some improvements to the debug window bzr revid: fva@openerp.com-20120913104621-zryga82o3d4vq174 --- addons/point_of_sale/static/src/css/pos.css | 16 +++++++--------- addons/point_of_sale/static/src/js/db.js | 8 ++++++++ addons/point_of_sale/static/src/js/devices.js | 4 ---- addons/point_of_sale/static/src/js/widgets.js | 7 ++++--- addons/point_of_sale/static/src/xml/pos.xml | 14 ++++++++------ 5 files changed, 27 insertions(+), 22 deletions(-) diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index a727986bb1c..8213df7fc44 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -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 ********* */ diff --git a/addons/point_of_sale/static/src/js/db.js b/addons/point_of_sale/static/src/js/db.js index 58ffa3373d6..66fce2e738e 100644 --- a/addons/point_of_sale/static/src/js/db.js +++ b/addons/point_of_sale/static/src/js/db.js @@ -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++){ diff --git a/addons/point_of_sale/static/src/js/devices.js b/addons/point_of_sale/static/src/js/devices.js index 65a28b5366a..a26d8ca7154 100644 --- a/addons/point_of_sale/static/src/js/devices.js +++ b/addons/point_of_sale/static/src/js/devices.js @@ -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); diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js index 0ae127e0b1b..f7746cbbd61 100644 --- a/addons/point_of_sale/static/src/js/widgets.js +++ b/addons/point_of_sale/static/src/js/widgets.js @@ -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(){ diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index 7c8b18a9bc3..7af3c2c2255 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -452,12 +452,14 @@

Hardware Events