[WIP] point_of_sale: making the standalone pos launchable from the pos backend
authorFrédéric van der Essen <fva@openerp.com>
Sat, 7 Dec 2013 17:00:14 +0000 (18:00 +0100)
committerFrédéric van der Essen <fva@openerp.com>
Sat, 7 Dec 2013 17:00:14 +0000 (18:00 +0100)
bzr revid: fva@openerp.com-20131207170014-9pctopzgx5ahtb21

addons/point_of_sale/__openerp__.py
addons/point_of_sale/controllers/main.py
addons/point_of_sale/point_of_sale.py
addons/point_of_sale/point_of_sale_view.xml
addons/point_of_sale/wizard/pos_session_opening.py

index 44ceb83..fa42a19 100644 (file)
@@ -100,11 +100,6 @@ Main Features
         'static/src/js/tests.js',
         'static/src/js/main.js',
     ],
-    'css': [
-        'static/src/css/pos.css', # this is the default css with hover effects
-        #'static/src/css/pos_nohover.css', # this css has no hover effects (for resistive touchscreens)
-        'static/src/css/keyboard.css'
-    ],
     'qweb': ['static/src/xml/pos.xml'],
     'auto_install': False,
 }
index 4871997..24cd29f 100644 (file)
@@ -32,7 +32,9 @@ html_template = """<!DOCTYPE html>
         <link rel="apple-touch-icon" sizes="152x152" href="/point_of_sale/static/src/img/touch-icon-ipad-retina.png">
 
         <link rel="shortcut icon" href="/web/static/src/img/favicon.ico" type="image/x-icon"/>
+        <!-- <link rel="stylesheet" href="/point_of_sale/static/src/fonts/lato/stylesheet.css" /> -->
         <link rel="stylesheet" href="/point_of_sale/static/src/css/pos.css" />
+        <!-- <link rel="stylesheet" href="/point_of_sale/static/src/css/keyboard.css" />-->
         %(js)s
         <script type="text/javascript">
             $(function() {
@@ -69,18 +71,14 @@ class PosController(http.Controller):
          #   'css': css,
             'modules': simplejson.dumps(module_boot(request.db)),
             'init': """
-                     console.log('LOADED');
                      var wc = new s.web.WebClient();
                      wc.show_application = function(){
-                         console.log('SHOW APPLICATION');
                          wc.action_manager.do_action("pos.ui");
                      };
                      wc.show_login = function(){
-                         console.log('SHOW LOGIN');
                          window.location.href = '/';
                      }
                      wc.appendTo($(document.body));
-                     console.log('APPENDED');
                      """
         }
         return r
index 61b7d83..a9a696f 100644 (file)
@@ -380,10 +380,9 @@ class pos_session(osv.osv):
         context.update(active_id=this_record.id)
 
         return {
-            'type' : 'ir.actions.client',
-            'name' : _('Start Point Of Sale'),
-            'tag' : 'pos.ui',
-            'context' : context,
+            'type' : 'ir.actions.act_url',
+            'url'  : '/pos/web/',
+            'target': 'self',
         }
 
     def wkf_action_open(self, cr, uid, ids, context=None):
@@ -486,10 +485,9 @@ class pos_session(osv.osv):
                         _("You cannot use the session of another users. This session is owned by %s. Please first close this one to use this point of sale." % session.user_id.name))
         context.update({'active_id': ids[0]})
         return {
-            'type' : 'ir.actions.client',
-            'name' : _('Start Point Of Sale'),
-            'tag' : 'pos.ui',
-            'context' : context,
+            'type' : 'ir.actions.act_url',
+            'target': 'self',
+            'url':   '/pos/web/',
         }
 
 class pos_order(osv.osv):
index b93c954..bdd59f9 100644 (file)
         <menuitem icon="STOCK_PRINT" action="action_report_pos_details"
                 id="menu_pos_details" parent="menu_point_rep" sequence="6" />
 
-        <record model="ir.actions.client" id="action_pos_pos">
+        <record model="ir.actions.act_url" id="action_pos_pos">
             <field name="name">Start Point of Sale</field>
-            <field name="tag">pos.ui</field>
+            <field name="url">/pos/web/</field>
+            <field name="target">self</field>
         </record>
 
         <!-- Top menu item -->
index 3d6e314..a9730d6 100644 (file)
@@ -28,10 +28,9 @@ class pos_session_opening(osv.osv_memory):
         data = self.browse(cr, uid, ids[0], context=context)
         context['active_id'] = data.pos_session_id.id
         return {
-            'type' : 'ir.actions.client',
-            'name' : _('Start Point Of Sale'),
-            'tag' : 'pos.ui',
-            'context' : context
+            'type' : 'ir.actions.act_url',
+            'url':   '/pos/web/',
+            'target': 'self',
         }
 
     def open_existing_session_cb_close(self, cr, uid, ids, context=None):