[IMP] point_of_sale: only load users belonging to a point of sale group
Conflicts: addons/point_of_sale/static/src/js/models.js
This commit is contained in:
committed by
Frédéric van der Essen
parent
b6ed8f9c77
commit
cb07bf8bae
@@ -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:
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user