Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I would like to set up two user groups for the Purchases module where the groups have access to different suppliers. One group will deal with all suppliers in Asia, while the other will deal with suppliers in Europe.
Is it possible to set up Record Rules to limit access based on the supplier address? If not, how would one go about setting up rules on a per-supplier basis?
You can use rules in groups to limit your record which will be country specific.
Lets consider an example
1.create new group for supplier deal with country 'India'
following rule will be
2.create new group for supplier deal with country 'USA'
following rule will be
hi, u may inherit res.country & res.users add in a new field maybe called it as "is_asia", so that each country will have identification belongs to which continent. Then u can inherit purchase order object's search function to add in continent filter.
class purchase_order(osv.osv): _inherit = "purchase.order" def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): is_asia = self.pool.get('res.users').browse(cr, uid, uid).is_asia partner_ids = self.pool.get('res.partners').search(cr, uid, [('is_asia','=',is_asia)]) args += [('partner_id','in',partner_ids)] return super(purchase_order, self).search(cr, uid, args, offset, limit, order, context, count) purchase_order()
hope it works
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 3/18/13, 1:55 PM|
|Seen: 1063 times|
|Last updated: 3/16/15, 8:10 AM|