1 # -*- coding: utf-8 -*-
9 from openerp import http
10 from openerp.http import request
11 from openerp.addons.web.controllers.main import manifest_list, module_boot, html_template
13 _logger = logging.getLogger(__name__)
15 html_template = """<!DOCTYPE html>
18 <title>OpenERP POS</title>
20 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
21 <meta http-equiv="content-type" content="text/html, charset=utf-8" />
23 <meta name="viewport" content=" width=1024, user-scalable=no">
24 <meta name="apple-mobile-web-app-capable" content="yes">
25 <meta name="mobile-web-app-capable" content="yes">
27 <link rel="shortcut icon" sizes="196x196" href="/point_of_sale/static/src/img/touch-icon-196.png">
28 <link rel="shortcut icon" sizes="128x128" href="/point_of_sale/static/src/img/touch-icon-128.png">
29 <link rel="apple-touch-icon" href="/point_of_sale/static/src/img/touch-icon-iphone.png">
30 <link rel="apple-touch-icon" sizes="76x76" href="/point_of_sale/static/src/img/touch-icon-ipad.png">
31 <link rel="apple-touch-icon" sizes="120x120" href="/point_of_sale/static/src/img/touch-icon-iphone-retina.png">
32 <link rel="apple-touch-icon" sizes="152x152" href="/point_of_sale/static/src/img/touch-icon-ipad-retina.png">
34 <link rel="shortcut icon" href="/web/static/src/img/favicon.ico" type="image/x-icon"/>
35 <link rel="stylesheet" href="/point_of_sale/static/src/fonts/lato/stylesheet.css" />
36 <link rel="stylesheet" href="/point_of_sale/static/src/fonts/font-awesome-4.0.3/css/font-awesome.min.css" />
37 <link rel="stylesheet" href="/point_of_sale/static/src/css/pos.css" />
38 <link rel="stylesheet" href="/point_of_sale/static/src/css/keyboard.css" />
40 <script type="text/javascript">
42 var s = new openerp.init(%(modules)s);
49 <script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
50 <script>CFInstall.check({mode: "overlay"});</script>
56 class PosController(http.Controller):
58 @http.route('/pos/web', type='http', auth='none')
59 def a(self, debug=False, **k):
62 js_list = manifest_list('js',db=request.db, debug=debug)
63 css_list = manifest_list('css',db=request.db, debug=debug)
68 js = "\n".join('<script type="text/javascript" src="%s"></script>' % i for i in js_list)
69 #css = "\n".join('<link rel="stylesheet" href="%s">' % i for i in css_list)
73 'modules': simplejson.dumps(module_boot(request.db)),
75 var wc = new s.web.WebClient();
76 wc.show_application = function(){
77 wc.action_manager.do_action("pos.ui");
79 wc.show_login = function(){
80 window.location.href = '/';
82 wc.appendTo($(document.body));