Odoo Help

Welcome!

This community 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.

0

How How do I make the user sees only his own customers ?

By
omar
on 2/10/16, 9:00 AM 431 views

How do I make the user sees only his own customers

And how to make the manager  sees  only his employees customers 

And how to make admin see all customers

you can use access rule. For admin, it bypass anyway all access rights and access rule.

Jérémy Kersten (jke)
on 2/10/16, 9:10 AM
0

Tarek Mohamed Ibrahim

--Tarek Mohamed Ibrahim--
896
| 5 3 7
Gîza, Egypt
--Tarek Mohamed Ibrahim--

I am an old VFP developer on ERP

I have moved to 2p since Nov-2014 and started developing with Python on Odoo.

https://www.linkedin.com/profile/public-profile-settings?trk=prof-edit-edit-public_profile

tibrahim@2p.com.sa

Tarek Mohamed Ibrahim
On 2/10/16, 12:09 PM

inherit the  'action_customer_partner_form' action and update the domain as follows

<field name="domain">[('customer','=',1),'|',('user_id.id','=',uid),('employee_id.department_id.manager_id.user_id.id','=',uid)]</field>

where the employee_id field is the related employee ID of the user who created the customer.

Using this, each user will see only the records he created only in the customer table, the department managers will see the records they created and all records created by their subordinates only.

As per Jérémy comment, the admin can see all records.

You have to add the employee_id feild to the 'res.partern' table and update it while adding new customers

I have tested this But I got an error: Traceback (most recent call last): File "C:\Program Files\Odoo 8.0-20151123\server\.\openerp\http.py", line 537, in _handle_exception File "C:\Program Files\Odoo 8.0-20151123\server\.\openerp\http.py", line 574, in dispatch File "C:\Program Files\Odoo 8.0-20151123\server\.\openerp\http.py", line 310, in _call_function File "C:\Program Files\Odoo 8.0-20151123\server\.\openerp\service\model.py", line 118, in wrapper File "C:\Program Files\Odoo 8.0-20151123\server\.\openerp\http.py", line 307, in checked_call File "C:\Program Files\Odoo 8.0-20151123\server\.\openerp\http.py", line 803, in __call__ File "C:\Program Files\Odoo 8.0-20151123\server\.\openerp\http.py", line 403, in response_wrap File "C:\Program Files\Odoo 8.0-20151123\server\openerp\addons\web\controllers\main.py", line 884, in search_read File "C:\Program Files\Odoo 8.0-20151123\server\openerp\addons\web\controllers\main.py", line 905, in do_search_read File "C:\Program Files\Odoo 8.0-20151123\server\.\openerp\http.py", line 908, in proxy File "C:\Program Files\Odoo 8.0-20151123\server\.\openerp\api.py", line 250, in wrapper File "C:\Program Files\Odoo 8.0-20151123\server\.\openerp\models.py", line 5167, in search_read File "C:\Program Files\Odoo 8.0-20151123\server\.\openerp\api.py", line 250, in wrapper File "C:\Program Files\Odoo 8.0-20151123\server\.\openerp\models.py", line 1645, in search File "C:\Program Files\Odoo 8.0-20151123\server\.\openerp\api.py", line 250, in wrapper File "C:\Program Files\Odoo 8.0-20151123\server\openerp\addons\base\res\res_partner.py", line 656, in _search File "C:\Program Files\Odoo 8.0-20151123\server\.\openerp\api.py", line 250, in wrapper File "C:\Program Files\Odoo 8.0-20151123\server\.\openerp\models.py", line 4672, in _search File "C:\Program Files\Odoo 8.0-20151123\server\.\openerp\api.py", line 250, in wrapper File "C:\Program Files\Odoo 8.0-20151123\server\.\openerp\models.py", line 4483, in _where_calc File "C:\Program Files\Odoo 8.0-20151123\server\.\openerp\osv\expression.py", line 662, in __init__ File "C:\Program Files\Odoo 8.0-20151123\server\.\openerp\osv\expression.py", line 830, in parse ValueError: Invalid field u'employee_id.department_id.manager_id.user_id.id' in leaf ""

omar
on 2/11/16, 12:20 AM
0
omar
On 2/10/16, 9:14 AM

what is the rule for the manager of user or employee to show only his users customers

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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 2/10/16, 9:00 AM
Seen: 431 times
Last updated: 2/11/16, 12:56 AM