diff --git a/addons/hw_escpos/controllers/main.py b/addons/hw_escpos/controllers/main.py
index 85309ea31c9..df0119ed302 100644
--- a/addons/hw_escpos/controllers/main.py
+++ b/addons/hw_escpos/controllers/main.py
@@ -267,12 +267,12 @@ hw_proxy.drivers['escpos'] = driver
class EscposProxy(hw_proxy.Proxy):
- @http.route('/hw_proxy/open_cashbox', type='json', auth='admin')
+ @http.route('/hw_proxy/open_cashbox', type='json', auth='none')
def open_cashbox(self):
_logger.info('ESC/POS: OPEN CASHBOX')
driver.push_task('cashbox')
- @http.route('/hw_proxy/print_receipt', type='json', auth='admin')
+ @http.route('/hw_proxy/print_receipt', type='json', auth='none')
def print_receipt(self, receipt):
_logger.info('ESC/POS: PRINT RECEIPT')
driver.push_task('receipt',receipt)
diff --git a/addons/hw_proxy/controllers/main.py b/addons/hw_proxy/controllers/main.py
index 3ea2de4424b..adb59a072b3 100644
--- a/addons/hw_proxy/controllers/main.py
+++ b/addons/hw_proxy/controllers/main.py
@@ -33,7 +33,7 @@ class Proxy(http.Controller):
statuses[driver] = drivers[driver].get_status()
return statuses
- @http.route('/hw_proxy/hello', type='http', auth='admin')
+ @http.route('/hw_proxy/hello', type='http', auth='none')
def hello(self):
return request.make_response('ping', {
'Cache-Control': 'no-cache',
@@ -42,11 +42,11 @@ class Proxy(http.Controller):
'Access-Control-Allow-Methods': 'GET',
})
- @http.route('/hw_proxy/handshake', type='json', auth='admin')
+ @http.route('/hw_proxy/handshake', type='json', auth='none')
def handshake(self):
return True
- @http.route('/hw_proxy/status', type='http', auth='admin')
+ @http.route('/hw_proxy/status', type='http', auth='none')
def status_http(self):
resp = '\n
\nHardware Proxy Status
\n'
statuses = self.get_status()
@@ -75,39 +75,39 @@ class Proxy(http.Controller):
'Access-Control-Allow-Methods': 'GET',
})
- @http.route('/hw_proxy/status_json', type='json', auth='admin')
+ @http.route('/hw_proxy/status_json', type='json', auth='none')
def status_json(self):
return self.get_status()
- @http.route('/hw_proxy/scan_item_success', type='json', auth='admin')
+ @http.route('/hw_proxy/scan_item_success', type='json', auth='none')
def scan_item_success(self, ean):
"""
A product has been scanned with success
"""
print 'scan_item_success: ' + str(ean)
- @http.route('/hw_proxy/scan_item_error_unrecognized', type='json', auth='admin')
+ @http.route('/hw_proxy/scan_item_error_unrecognized', type='json', auth='none')
def scan_item_error_unrecognized(self, ean):
"""
A product has been scanned without success
"""
print 'scan_item_error_unrecognized: ' + str(ean)
- @http.route('/hw_proxy/help_needed', type='json', auth='admin')
+ @http.route('/hw_proxy/help_needed', type='json', auth='none')
def help_needed(self):
"""
The user wants an help (ex: light is on)
"""
print "help_needed"
- @http.route('/hw_proxy/help_canceled', type='json', auth='admin')
+ @http.route('/hw_proxy/help_canceled', type='json', auth='none')
def help_canceled(self):
"""
The user stops the help request
"""
print "help_canceled"
- @http.route('/hw_proxy/weighting_start', type='json', auth='admin')
+ @http.route('/hw_proxy/weighting_start', type='json', auth='none')
def weighting_start(self):
if self.scale == 'closed':
print "Opening (Fake) Connection to Scale..."
@@ -118,7 +118,7 @@ class Proxy(http.Controller):
else:
print "WARNING: Scale already Connected !!!"
- @http.route('/hw_proxy/weighting_read_kg', type='json', auth='admin')
+ @http.route('/hw_proxy/weighting_read_kg', type='json', auth='none')
def weighting_read_kg(self):
if self.scale == 'open':
print "Reading Scale..."
@@ -130,7 +130,7 @@ class Proxy(http.Controller):
print "WARNING: Reading closed scale !!!"
return 0.0
- @http.route('/hw_proxy/weighting_end', type='json', auth='admin')
+ @http.route('/hw_proxy/weighting_end', type='json', auth='none')
def weighting_end(self):
if self.scale == 'open':
print "Closing Connection to Scale ..."
@@ -141,7 +141,7 @@ class Proxy(http.Controller):
else:
print "WARNING: Scale already Closed !!!"
- @http.route('/hw_proxy/payment_request', type='json', auth='admin')
+ @http.route('/hw_proxy/payment_request', type='json', auth='none')
def payment_request(self, price):
"""
The PoS will activate the method payment
@@ -149,55 +149,55 @@ class Proxy(http.Controller):
print "payment_request: price:"+str(price)
return 'ok'
- @http.route('/hw_proxy/payment_status', type='json', auth='admin')
+ @http.route('/hw_proxy/payment_status', type='json', auth='none')
def payment_status(self):
print "payment_status"
return { 'status':'waiting' }
- @http.route('/hw_proxy/payment_cancel', type='json', auth='admin')
+ @http.route('/hw_proxy/payment_cancel', type='json', auth='none')
def payment_cancel(self):
print "payment_cancel"
- @http.route('/hw_proxy/transaction_start', type='json', auth='admin')
+ @http.route('/hw_proxy/transaction_start', type='json', auth='none')
def transaction_start(self):
print 'transaction_start'
- @http.route('/hw_proxy/transaction_end', type='json', auth='admin')
+ @http.route('/hw_proxy/transaction_end', type='json', auth='none')
def transaction_end(self):
print 'transaction_end'
- @http.route('/hw_proxy/cashier_mode_activated', type='json', auth='admin')
+ @http.route('/hw_proxy/cashier_mode_activated', type='json', auth='none')
def cashier_mode_activated(self):
print 'cashier_mode_activated'
- @http.route('/hw_proxy/cashier_mode_deactivated', type='json', auth='admin')
+ @http.route('/hw_proxy/cashier_mode_deactivated', type='json', auth='none')
def cashier_mode_deactivated(self):
print 'cashier_mode_deactivated'
- @http.route('/hw_proxy/open_cashbox', type='json', auth='admin')
+ @http.route('/hw_proxy/open_cashbox', type='json', auth='none')
def open_cashbox(self):
print 'open_cashbox'
- @http.route('/hw_proxy/print_receipt', type='json', auth='admin')
+ @http.route('/hw_proxy/print_receipt', type='json', auth='none')
def print_receipt(self, receipt):
print 'print_receipt' + str(receipt)
- @http.route('/hw_proxy/is_scanner_connected', type='json', auth='admin')
+ @http.route('/hw_proxy/is_scanner_connected', type='json', auth='none')
def print_receipt(self, receipt):
print 'is_scanner_connected?'
return False
- @http.route('/hw_proxy/scanner', type='json', auth='admin')
+ @http.route('/hw_proxy/scanner', type='json', auth='none')
def print_receipt(self, receipt):
print 'scanner'
time.sleep(10)
return ''
- @http.route('/hw_proxy/log', type='json', auth='admin')
+ @http.route('/hw_proxy/log', type='json', auth='none')
def log(self, arguments):
_logger.info(' '.join(str(v) for v in arguments))
- @http.route('/hw_proxy/print_pdf_invoice', type='json', auth='admin')
+ @http.route('/hw_proxy/print_pdf_invoice', type='json', auth='none')
def print_pdf_invoice(self, pdfinvoice):
print 'print_pdf_invoice' + str(pdfinvoice)
diff --git a/addons/hw_scanner/controllers/main.py b/addons/hw_scanner/controllers/main.py
index 3e487cab404..664606954c3 100644
--- a/addons/hw_scanner/controllers/main.py
+++ b/addons/hw_scanner/controllers/main.py
@@ -109,8 +109,8 @@ class Scanner(Thread):
if not evdev:
return None
devices = [ device for device in listdir(self.input_dir)]
- keyboards = [ device for device in devices if 'kbd' in device ]
- scanners = [ device for device in devices if ('barcode' in device.lower()) or ('scanner' in device.lower()) ]
+ keyboards = [ device for device in devices if ('kbd' in device) and ('keyboard' not in device.lower())]
+ scanners = [ device for device in devices if ('barcode' in device.lower()) or ('scanner' in device.lower())]
if len(scanners) > 0:
self.set_status('connected','Connected to '+scanners[0])
return evdev.InputDevice(join(self.input_dir,scanners[0]))
@@ -124,7 +124,7 @@ class Scanner(Thread):
self.set_status('error',str(e))
return None
- @http.route('/hw_proxy/Vis_scanner_connected', type='json', auth='admin')
+ @http.route('/hw_proxy/Vis_scanner_connected', type='json', auth='none')
def is_scanner_connected(self):
return self.get_device() != None
@@ -144,6 +144,8 @@ class Scanner(Thread):
return ''
def get_status(self):
+ if not s.isAlive():
+ s.start()
return self.status
def run(self):
@@ -205,7 +207,7 @@ s = Scanner()
hw_proxy.drivers['scanner'] = s
class ScannerDriver(hw_proxy.Proxy):
- @http.route('/hw_proxy/scanner', type='json', auth='admin')
+ @http.route('/hw_proxy/scanner', type='json', auth='none')
def scanner(self):
if not s.isAlive():
s.start()
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js
index 0a15e625b5d..f65cf3b64f3 100644
--- a/addons/point_of_sale/static/src/js/models.js
+++ b/addons/point_of_sale/static/src/js/models.js
@@ -92,6 +92,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
},
connect_to_proxy: function(){
var self = this;
+ var done = new $.Deferred();
this.barcode_reader.disconnect_from_proxy();
this.pos_widget.loading_message(_t('Connecting to the PosBox'),0);
this.pos_widget.loading_skip(function(){
@@ -106,7 +107,10 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
if(self.config.iface_scan_via_proxy){
self.barcode_reader.connect_to_proxy();
}
+ }).always(function(){
+ done.resolve();
});
+ return done;
},
// helper function to load data from the server