Odoo Help


How create rule for personal customers

on 5/9/13, 9:14 AM 3,986 views

Hi, I need to create a rule to a user can only see (and write, create and delete) their own customers (SALES / CUSTOMERS in OpenERP menu), similar at rules "personal phone calls" or "personal leads" in the "Sales / User: Own Leads Only".

I have resolved (partially) the problem with a new rule based on "res_partner: access (read) on my partner" with the same DOMAIN and I have modified this rule to grant access to read, write, create and delete and now a user only can see his partners but now, when I try create a new partner, like a contact or company, I cant, because the system tell me access denied (document type: partner and action create). I dont know why can't create a new partner.

My version OpenERP is 7.0

Can anyone help me?




Priyesh Solanki (pso)

--Priyesh Solanki (pso)--

| 2 2 4
--Priyesh Solanki (pso)--
Priyesh Solanki (pso)
On 5/9/13, 9:18 AM

You need to use this domain in your new record rule:


After setting this domain in your record rule, save it and again check your scenario.

By applying this domain, You will see your own customers as well as the customers, in which, there is no Salesperson defined. If possible, define salesperson for every customer so it will give you the exact result that you want.

Thanks Priyesh, I have test this domain in new rule. This domain is the same that PERSONAL PHONE CALLS rule or PERSONAL LEADS, but, the problem is when I try crearte a new customer, I cant. OpenERP tell me ACCESS DENIED: document: partner and action create. In the new rule I have set read, create, write and delete permissions, but doesn't work and I cant understand why. The user that I use to check this rule, only is in one group, and this group have three rules, PERSONAL LEADS, PERSONAL PHONE CALLS and the new rule, PERSONAL CUSTOMERS, and only personal customers rule doesn't work.

on 5/9/13, 9:36 AM

In Partner form while creating, In Sales & Purchase tab, There is a Salesperson over there. Kindly set it as your logged user and try to create it. It should work. May be its clashing with our domain in record rule.

Priyesh Solanki (pso)
on 5/9/13, 9:48 AM

Good again. As I was not sure of the changes he had made in OpenERP, I decided to reinstall it. Starting from a clean install, now I have two users, "admin" and "partner01". Partner01 is assigned to "own leads only" and I have added another group "own parterns only" with a rule with the new domain (your domain) over res_partner. I have created another user partner02 assigned only to "own leads only" group. Now, when I access with partner01 user and I try sales / customer menu, I see all...all users, all companies...all. The rule seems doesnt work. Any Idea? Thanks again.

on 5/15/13, 2:44 PM

oh, I have re-read your first comment and I haven seen that this rule works if you set the sales person...and yes, your right. If you set the sales person then the user only see the partners with the sales person is he and if there is not sales person set. ok. ¿There is a way to a user when create a partner, the sales person it be set in automatic form to the same user that create the partner?

on 5/15/13, 3:07 PM

_defaults = { 'user_id': lambda self, cr, uid, context: uid, } By adding this, When you will create a new partner, Logger user will automatically set as sales person.

Priyesh Solanki (pso)
on 5/16/13, 3:00 AM

Add this code in res.partner object in _defaults value. It should work.

Priyesh Solanki (pso)
on 5/16/13, 3:01 AM

Ok Priyesh, thanks for your help.

on 5/16/13, 8:05 AM

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

1 follower(s)


Asked: 5/9/13, 9:14 AM
Seen: 3986 times
Last updated: 3/16/15, 8:10 AM