Merge pull request #813 from odoo-dev/master-fix-pos-barcodeint-init-sle

[FIX] point of sale and barcode interface 'mini webclien' initialisation
This commit is contained in:
sle-odoo 2014-06-27 17:20:40 +02:00
commit 8915883a43
2 changed files with 25 additions and 7 deletions

View File

@ -46,6 +46,14 @@ html_template = """<!DOCTYPE html>
</script>
</head>
<body>
<div class="openerp openerp_webclient_container">
<table class="oe_webclient">
<tr>
<td class="oe_application"/>
</tr>
</table>
</div>
<!--[if lte IE 8]>
<script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
<script>CFInstall.check({mode: "overlay"});</script>
@ -69,7 +77,8 @@ class PosController(http.Controller):
wc.show_application = function(){
wc.action_manager.do_action("pos.ui");
};
wc.appendTo($(document.body));
wc.setElement($(document.body));
wc.start();
"""
}
return r

View File

@ -36,6 +36,14 @@ html_template = """<!DOCTYPE html>
</script>
</head>
<body>
<div class="openerp openerp_webclient_container">
<table class="oe_webclient">
<tr>
<td class="oe_application"/>
</tr>
</table>
</div>
<!--[if lte IE 8]>
<script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
<script>CFInstall.check({mode: "overlay"});</script>
@ -54,12 +62,13 @@ class BarcodeController(http.Controller):
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.appendTo($(document.body));
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