From 1fc53113a47cd68953adb23fc1cb9152362bb378 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 18 Oct 2011 16:17:44 +0200 Subject: [PATCH 1/5] [ADD] point_of_sale: web client section to the descriptor keys, to describe static files to load bzr revid: xmo@openerp.com-20111018141744-kvvspjhd28xd96sz --- addons/point_of_sale/__openerp__.py | 3 +++ addons/point_of_sale/static/src/js/pos.js | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/point_of_sale/__openerp__.py b/addons/point_of_sale/__openerp__.py index 1f6a808d2a0..b619f7e3a3f 100644 --- a/addons/point_of_sale/__openerp__.py +++ b/addons/point_of_sale/__openerp__.py @@ -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/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 6100158547d..0347447c912 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1,6 +1,3 @@ - -openerp.point_of_sale = {}; - openerp.point_of_sale = function(db) { db.point_of_sale = {}; From ea3fd05d049644c742008d9c378adc2e8e722521 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 18 Oct 2011 16:33:52 +0200 Subject: [PATCH 2/5] [ADD] menu item for POS main UI bzr revid: xmo@openerp.com-20111018143352-zv3m10l2l02o1tw7 --- addons/point_of_sale/account_statement_view.xml | 2 +- addons/point_of_sale/point_of_sale_view.xml | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) 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 + + + + From 4693f2ee6b8457ee30f970124e46b46f75041f0d Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 18 Oct 2011 16:59:44 +0200 Subject: [PATCH 3/5] [ADD] POS direct integration in OpenERP web client bzr revid: xmo@openerp.com-20111018145944-f5lvmywebzox9jsu --- addons/point_of_sale/__openerp__.py | 2 +- addons/point_of_sale/static/src/css/pos.css | 4 +++- addons/point_of_sale/static/src/js/pos.js | 7 ++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/addons/point_of_sale/__openerp__.py b/addons/point_of_sale/__openerp__.py index b619f7e3a3f..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. 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 0347447c912..57c47f741ec 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1183,10 +1183,15 @@ 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) From 50c3881f8391e7f6f46a536107ff0ce707d214f1 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 18 Oct 2011 17:00:06 +0200 Subject: [PATCH 4/5] [IMP] cleanup whitespace because meh bzr revid: xmo@openerp.com-20111018150006-5flnm6k4v9h0mcxj --- addons/point_of_sale/static/src/js/pos.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 57c47f741ec..086bc38cf65 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1,6 +1,6 @@ openerp.point_of_sale = function(db) { db.point_of_sale = {}; - + /* Some utility functions defined by Coffee script */ var __bind = function(fn, me) { return function() { @@ -39,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. @@ -158,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 @@ -585,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) { @@ -960,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); @@ -1193,14 +1193,14 @@ openerp.point_of_sale = function(db) { // 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(); From 8901dd3c219b2bc376baf6275b77324e905ebb76 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 18 Oct 2011 17:01:04 +0200 Subject: [PATCH 5/5] [REM] pos demo HTML file bzr revid: xmo@openerp.com-20111018150104-wo5eu2qpg9ffx9vj --- addons/point_of_sale/static/src/pos.html | 45 ------------------------ 1 file changed, 45 deletions(-) delete mode 100644 addons/point_of_sale/static/src/pos.html 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 - - - - - - - - - - - - - - - - - - - - - - - - -