diff --git a/addons/stock/controllers/main.py b/addons/stock/controllers/main.py
index ad8aa8826af..44531169254 100644
--- a/addons/stock/controllers/main.py
+++ b/addons/stock/controllers/main.py
@@ -1,74 +1,16 @@
# -*- coding: utf-8 -*-
import logging
-import simplejson
from openerp import http
from openerp.http import request
-from openerp.addons.web.controllers.main import module_boot
_logger = logging.getLogger(__name__)
-html_template = """
-
-
- Barcode Scanner
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-"""
-
class BarcodeController(http.Controller):
- @http.route(['/barcode/web/'], type='http', auth='user')
+ @http.route(['/stock/barcode/'], type='http', auth='user')
def a(self, debug=False, **k):
if not request.session.uid:
- return http.local_redirect('/web/login?redirect=/barcode/web')
+ return http.local_redirect('/web/login?redirect=/stock/barcode/')
- r = html_template % {
- 'modules': simplejson.dumps(module_boot(request.db)),
- 'init': """
- var wc = new s.web.WebClient();
- wc.show_application = function(){
- wc.action_manager.do_action("stock.ui", {});
- };
- wc.do_push_state = function(state){};
- wc.setElement($(document.body));
- wc.start();
- """
- }
- return r
+ return request.render('stock.barcode_index')
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 8da55a82fcb..1146d628ac9 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -1070,7 +1070,7 @@ class stock_picking(osv.osv):
@api.cr_uid_ids_context
def open_barcode_interface(self, cr, uid, picking_ids, context=None):
- final_url="/barcode/web/#action=stock.ui&picking_id="+str(picking_ids[0])
+ final_url="/stock/barcode/#action=stock.ui&picking_id="+str(picking_ids[0])
return {'type': 'ir.actions.act_url', 'url':final_url, 'target': 'self',}
@api.cr_uid_ids_context
@@ -4038,7 +4038,7 @@ class stock_picking_type(osv.osv):
_order = 'sequence'
def open_barcode_interface(self, cr, uid, ids, context=None):
- final_url = "/barcode/web/#action=stock.ui&picking_type_id=" + str(ids[0]) if len(ids) else '0'
+ final_url = "/stock/barcode/#action=stock.ui&picking_type_id=" + str(ids[0]) if len(ids) else '0'
return {'type': 'ir.actions.act_url', 'url': final_url, 'target': 'self'}
def _get_tristate_values(self, cr, uid, ids, field_name, arg, context=None):
diff --git a/addons/stock/views/stock.xml b/addons/stock/views/stock.xml
index a38fe9bb9fe..f5bca7a8f7c 100644
--- a/addons/stock/views/stock.xml
+++ b/addons/stock/views/stock.xml
@@ -3,11 +3,64 @@
-->
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+<!DOCTYPE html>
+
+
+ Barcode Scanner
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+