From 21b1cc3f89e7298a99ff820bd461759bd323fbd9 Mon Sep 17 00:00:00 2001 From: Frederic van der Essen Date: Mon, 17 Nov 2014 16:16:07 +0100 Subject: [PATCH] [FIX] point_of_sale: only load cashier belonging to the pos's company, cashier without PINs could not be set Conflicts: addons/point_of_sale/static/src/js/models.js --- addons/point_of_sale/static/src/js/models.js | 2 +- addons/point_of_sale/static/src/js/widgets.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 28f162b6068..8b9dc2ecec0 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -229,7 +229,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal },{ model: 'res.users', fields: ['name','pos_security_pin','groups_id','barcode'], - domain: function(self){ return ['|', ['groups_id','=', self.config.group_pos_manager_id[0]],['groups_id','=', self.config.group_pos_user_id[0]]]; }, + domain: function(self){ return [['company_id','=',self.user.company_id[0]],'|', ['groups_id','=', self.config.group_pos_manager_id[0]],['groups_id','=', self.config.group_pos_user_id[0]]]; }, loaded: function(self,users){ // we attribute a role to the user, 'cashier' or 'manager', depending // on the group the user belongs. diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js index 615e5648842..43d0a92ae40 100644 --- a/addons/point_of_sale/static/src/js/widgets.js +++ b/addons/point_of_sale/static/src/js/widgets.js @@ -1056,7 +1056,9 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa }); return ret; - } + } else { + return user; + } }); },