diff --git a/addons/point_of_sale/__openerp__.py b/addons/point_of_sale/__openerp__.py index 1f6a808d2a0..4daeabb9129 100644 --- a/addons/point_of_sale/__openerp__.py +++ b/addons/point_of_sale/__openerp__.py @@ -22,7 +22,7 @@ { 'name': 'Point Of Sale', - 'version': '1.0', + 'version': '1.0.1', 'category': 'Point Of Sale', 'description': """ This module provides a quick and easy sale process. @@ -80,5 +80,8 @@ Main features : ], 'installable': True, 'certificate' : '001156338024966477869', + # Web client + 'js': ['static/lib/backbone/backbone-0.5.3.js', 'static/src/js/pos.js'], + 'css': ['static/src/css/pos.css'] } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/point_of_sale/account_statement_view.xml b/addons/point_of_sale/account_statement_view.xml index 16cc953d9ef..d6c4b3f244a 100644 --- a/addons/point_of_sale/account_statement_view.xml +++ b/addons/point_of_sale/account_statement_view.xml @@ -129,7 +129,7 @@ + id="menu_point_open_config" sequence="10"/> - + @@ -791,6 +791,16 @@ + + Start Point of Sale + pos.ui + + + Start Point of Sale + + + + diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index 8b5b11cc01e..24eb704b7dc 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -6,7 +6,9 @@ font-family: "Lucida Grande", Helvetica, Verdana, Arial; color: #555555; font-size: 12px; - position: relative; + position: absolute; + left: 0; + top: 0; width: 100%; height: 100%; } diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 6100158547d..086bc38cf65 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1,9 +1,6 @@ - -openerp.point_of_sale = {}; - openerp.point_of_sale = function(db) { db.point_of_sale = {}; - + /* Some utility functions defined by Coffee script */ var __bind = function(fn, me) { return function() { @@ -42,7 +39,7 @@ openerp.point_of_sale = function(db) { return QWeb.render(template, ctx); }; }; - + /* Local store access. Read once from localStorage upon construction and persist on every change. There should only be one store active at any given time to ensure data consistency. @@ -161,16 +158,16 @@ openerp.point_of_sale = function(db) { }; return Pos; })(); - + /* global variable */ var pos; - + var App, CashRegister, CashRegisterCollection, Category, CategoryCollection, CategoryView, NumpadState, NumpadView, Order, OrderButtonView, OrderCollection, OrderView, Orderline, OrderlineCollection, OrderlineView, PaymentButtonView, PaymentView, Paymentline, PaymentlineCollection, PaymentlineView, PaypadView, Product, ProductCollection, ProductListView, ProductView, ReceiptLineView, ReceiptView, Shop, ShopView, StepsView; - + /* --- Models @@ -588,7 +585,7 @@ openerp.point_of_sale = function(db) { /* set correct view */ $('.step-screen').hide(); $('#payment-screen').show(); - + cashRegisterId = event.currentTarget.attributes['cash-register-id'].nodeValue; cashRegisterCollection = this.shop.get('cashRegisters'); cashRegister = cashRegisterCollection.find(__bind( function(item) { @@ -963,7 +960,7 @@ openerp.point_of_sale = function(db) { function ReceiptView() { ReceiptView.__super__.constructor.apply(this, arguments); } - + ReceiptView.prototype.initialize = function(options) { this.shop = options.shop; this.shop.bind('change:selectedOrder', this.changeSelectedOrder, this); @@ -1186,19 +1183,24 @@ openerp.point_of_sale = function(db) { }; return App; })(); - + + db.web.client_actions.add('pos.ui', 'db.point_of_sale.PointOfSale'); db.point_of_sale.PointOfSale = db.web.Widget.extend({ template: "PointOfSale", start: function() { + // FIXME: absolutely horrible hack to avoid conflict + // between backbone's history and al's action + // thingie + window.location.hash = ''; var self = this; - + if (pos) throw "It is not possible to instantiate multiple instances"+ "of the point of sale at the same time."; pos = new Pos(this.session); - + this.$element.find('#steps').buttonset(); - + return pos.ready.then( function() { pos.app = new App(self.$element); return Backbone.history.start(); diff --git a/addons/point_of_sale/static/src/pos.html b/addons/point_of_sale/static/src/pos.html deleted file mode 100644 index 2484e0a612c..00000000000 --- a/addons/point_of_sale/static/src/pos.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - Point of Sale - - - - - - - - - - - - - - - - - - - - - - - - -