Skip to Content
Menu
This question has been flagged
1 Reply
2045 Views

Hello everyone, I want to split customers according to company I mean user can see only customers if customers are in user's company, I wrote Record Rule but there is error.

Due to security restrictions, you are not allowed to access 'Contact' (res.partner) records.
Records: branch1_user (id=8)
User: branch1_user (id=6)
This restriction is due to the following rules:
- Customers only own
Note: this might be a multi-company issue.
Contact your administrator to request access if necessary.

Domain filter in Model Record Rules:
['|','parent_id.company_id.id','=',user.company_id.id),('parent_id.company_id','=',False)]
Avatar
Discard
Author Best Answer

I have found solution,

in Customers we should select company in customer detail page( Sales & Purchase tab ->Company)

then we should write rule for this, rule :

['|',('company_id','=',user.company_id.id),('company_id','=',False)]
Avatar
Discard
Related Posts Replies Views Activity
1
Nov 24
1483
1
Nov 24
1189
2
Sep 24
1047
1
Aug 24
2453
3
Aug 24
2686