[IMP] point_of_sale: only load users belonging to a point of sale group
authorFrederic van der Essen <fva@openerp.com / fvdessen+o@gmail.com>
Thu, 13 Nov 2014 17:08:37 +0000 (18:08 +0100)
committerFrédéric van der Essen <fvdessen@gmail.com>
Wed, 26 Nov 2014 11:11:50 +0000 (12:11 +0100)
Conflicts:
addons/point_of_sale/static/src/js/models.js

addons/point_of_sale/point_of_sale.py
addons/point_of_sale/static/src/js/models.js

index 8175041..360a36c 100644 (file)
@@ -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:
index f72e5b8..28f162b 100644 (file)
@@ -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.