diff --git a/addons/point_of_sale/__init__.py b/addons/point_of_sale/__init__.py index bf0b86a0e9d..7a786ebb5f1 100644 --- a/addons/point_of_sale/__init__.py +++ b/addons/point_of_sale/__init__.py @@ -22,6 +22,7 @@ import point_of_sale import account_bank_statement import res_users +import res_partner import wizard import report diff --git a/addons/point_of_sale/__openerp__.py b/addons/point_of_sale/__openerp__.py index e9dd628243b..0823a573ab6 100644 --- a/addons/point_of_sale/__openerp__.py +++ b/addons/point_of_sale/__openerp__.py @@ -74,6 +74,7 @@ Main Features 'account_statement_view.xml', 'account_statement_report.xml', 'res_users_view.xml', + 'res_partner_view.xml', ], 'demo': [ 'point_of_sale_demo.xml', diff --git a/addons/point_of_sale/point_of_sale_data.xml b/addons/point_of_sale/point_of_sale_data.xml index 01d8dd9ff60..2e9cf84ff39 100644 --- a/addons/point_of_sale/point_of_sale_data.xml +++ b/addons/point_of_sale/point_of_sale_data.xml @@ -1,6 +1,30 @@ - + + + + 0420100000005 + 0420200000004 + 0420300000003 + 0420400000002 + 0420500000001 + 0420600000000 + 0420700000009 + 0420800000008 + 0420900000007 + 0421000000003 + 0421100000002 + 0421200000001 + 0421300000000 + 0421400000009 + 0421500000008 + 0421600000007 + 0421700000006 + 0421800000005 + 0421900000004 + 0422000000000 + 0422100000009 + Open POS Menu diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index 9b286be250e..a8cb56dd7f8 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -800,12 +800,25 @@ #receipt-screen { text-align: left; } + .pos-actionbar { + display: none !important; + } .pos-sale-ticket { margin: 0; } .debug-widget{ display: none !important; } + .point-of-sale *{ + text-shadow: none !important; + box-shadow: none !important; + background: transparent !important; + } + .point-of-sale .pos-sale-ticket{ + margin-left: auto !important; + margin-right: auto !important; + border: solid 1px black !important; + } } /* d) The Scale screen */ diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index f1462424f1e..9a96df7e221 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -36,6 +36,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal 'company': null, 'user': null, // the user that loaded the pos 'user_list': null, // list of all users + 'partner_list': null, // list of all partners with an ean 'cashier': null, // the logged cashier, if different from user 'orders': new module.OrderCollection(), @@ -121,6 +122,11 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal }).then(function(users){ self.set('user_list',users); + return self.fetch('res.partner', ['name','ean13'], [['ean13', '!=', false]]); + }).then(function(partners){ + self.set('partner_list',partners); + console.log('Loaded partners:',partners); + return self.fetch('account.tax', ['amount', 'price_include', 'type']); }).then(function(taxes){ self.set('taxes', taxes); @@ -657,6 +663,10 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal get_client: function(){ return this.get('client'); }, + get_client_name: function(){ + var client = this.get('client'); + return client ? client.name : ""; + }, // the order also stores the screen status, as the PoS supports // different active screens per order. This method is used to // store the screen status. diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 61c6d1cc2b8..b783b170f9e 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -198,10 +198,10 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa // - if there's a user with a matching ean, put it as the active 'client' and return true // - else : return false. barcode_client_action: function(ean){ - var users = this.pos.get('user_list'); - for(var i = 0, len = users.length; i < len; i++){ - if(users[i].ean13 === ean.ean){ - this.pos.get('selectedOrder').set_client(users[i]); + var partners = this.pos.get('partner_list'); + for(var i = 0, len = partners.length; i < len; i++){ + if(partners[i].ean13 === ean.ean){ + this.pos.get('selectedOrder').set_client(partners[i]); this.pos_widget.username.refresh(); this.pos.proxy.scan_item_success(ean); return true; diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js index 6038a74b35e..c983b87168e 100644 --- a/addons/point_of_sale/static/src/js/widgets.js +++ b/addons/point_of_sale/static/src/js/widgets.js @@ -323,10 +323,11 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa template:'OrderButtonWidget', init: function(parent, options) { this._super(parent,options); + var self = this; + this.order = options.order; - this.order.bind('destroy', _.bind( function() { - this.destroy(); - }, this)); + this.order.bind('destroy',function(){ self.destroy(); }); + this.order.bind('change', function(){ self.renderElement(); }); this.pos.bind('change:selectedOrder', _.bind( function(pos) { var selectedOrder; selectedOrder = pos.get('selectedOrder'); @@ -337,8 +338,8 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa }, renderElement:function(){ this._super(); - this.$('button.select-order').click(_.bind(this.selectOrder, this)); - this.$('button.close-order').click(_.bind(this.closeOrder, this)); + this.$('button.select-order').off('click').click(_.bind(this.selectOrder, this)); + this.$('button.close-order').off('click').click(_.bind(this.closeOrder, this)); }, selectOrder: function(event) { this.pos.set({ @@ -667,7 +668,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa template: "DebugWidget", eans:{ admin_badge: '0410100000006', - client_badge: '0420100000005', + client_badge: '0420200000004', invalid_ean: '1232456', soda_33cl: '5449000000996', oranges_kg: '2100002031410', diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index 6171869cbb4..e43c0d39bbb 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -536,7 +536,7 @@
  • - +