From cb07bf8bae7c68f68fd2efcd43992af962f78bea Mon Sep 17 00:00:00 2001 From: Frederic van der Essen Date: Thu, 13 Nov 2014 18:08:37 +0100 Subject: [PATCH] [IMP] point_of_sale: only load users belonging to a point of sale group Conflicts: addons/point_of_sale/static/src/js/models.js --- addons/point_of_sale/point_of_sale.py | 3 +-- addons/point_of_sale/static/src/js/models.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 8175041db05..360a36c436f 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -171,14 +171,13 @@ class pos_config(osv.osv): print company_id return company_id -<<<<<<< HEAD def _get_default_nomenclature(self, cr, uid, context=None): nom_obj = self.pool.get('barcode.nomenclature') res = nom_obj.search(cr, uid, [], limit=1, context=context) if res and res[0]: return nom_obj.browse(cr, uid, res[0], context=context).id return False -======= + def _get_group_pos_manager(self, cr, uid, context=None): group = self.pool.get('ir.model.data').get_object_reference(cr,uid,'point_of_sale','group_pos_manager') if group: diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index f72e5b8dc80..28f162b6068 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: null, + domain: function(self){ return ['|', ['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.