Odoo Help


Purchases: set access rights based on supplier location?

on 3/18/13, 1:55 PM 1,089 views


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?

Thanks, Lawrence

shashank verma
On 5/9/14, 2:52 AM


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


Domain filter:


2.create new group for supplier deal with country 'USA'

following rule will be


Domain filter:


On 5/8/14, 11:42 PM

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)

hope it works

Your Answer

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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 3/18/13, 1:55 PM
Seen: 1089 times
Last updated: 3/16/15, 8:10 AM