diff --git a/pos_backend_partner/README.rst b/pos_backend_partner/README.rst index a10fdd49..b23155de 100644 --- a/pos_backend_partner/README.rst +++ b/pos_backend_partner/README.rst @@ -12,6 +12,13 @@ Choose a POS customer from the backend. - Benefit from the backend features: advanced search, easy to extend views, etc. +Warning about offline mode +-------------------------- + +Due to design of this module, you can't choose a _named customer_ while offline but you +can still register orders with _anonymous_ user. + + Configuration ============= diff --git a/pos_backend_partner/static/src/js/pos_partner.js b/pos_backend_partner/static/src/js/pos_partner.js index b7e063d8..ee4ba772 100644 --- a/pos_backend_partner/static/src/js/pos_partner.js +++ b/pos_backend_partner/static/src/js/pos_partner.js @@ -33,24 +33,35 @@ odoo.define('pos_backend_partner.partner_pos', function (require) { }); } + // Bind customer button in main screen ProductScreenWidget.ActionpadWidget.include({ - init: function(parent, options) { - this._super(parent, options); - pos_instance = this.pos; - - }, - renderElement: function() { + init: function(parent, options) { + this._super(parent, options); + pos_instance = this.pos; + }, + renderElement: function() { var self = this; this._super(); this.$('.set-customer').unbind('click'); this.$('.set-customer').click(function(){ open_backend(); }); - } + } + }); + + // Bind customer button in payement screen + ProductScreenWidget.PaymentScreenWidget.include({ + init: function(parent, options) { + this._super(parent, options); + pos_instance = this.pos; + }, + click_set_customer: function() { + open_backend(); + } }); - + tools.callbacks['partner.partner_selected'] = set_client; - + return { callbacks: tools.callbacks };