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

Hi Guys,


a brain buster here (or i have been up too long.

I would like to have users see their own partners (multi company) and partners that dont have a specific company allocated but I dont want them to be able to edit the partners that are shared across companies.

I just cant get the global search and group search to work  to do this.

typicaly with multi company you would have the below global search 

['|',('company_id','=',False),('company_id', 'in', company_ids)]  with all access boxes ticked

and then refine access by groups after that , 

I want sales users to then be restricted so they cant edit shared partners  but no mater what i try they can still edit. I thought i would just have to restrict their group to read only with a rule definition of 

[('company_id','=',False)]  


but it doesnt seem to be working


appriciate any ideas




Avatar
Discard
Author Best Answer

Turns out my rules were good .

I didnt use a global rule and just used groups to :

1) give read access to own comapnaies and unassigned companies

2) give write access to own companies


the reason it wasnt working was there is a private rule that was causing issues with everything else using res.partner


res.partner.rule.private.employee  

['|', ('type', '!=', 'private'), ('type', '=', False)]  

its referencing internal user type group which is top of the tree which is part of the issue i think

once i deactivated this it all works perfectly (and i can created further rules that work for sales admin .


the private rule is impacting because of the "or" structure of group rules but i need to do more work to figure out why and what impact deactivating private rule will have (we dont use payroll or hr so i dont think its important to us)

Avatar
Discard

You'll also have a similar issue with the counter to that group. (res.partner.rule.private.group)

If anyone had this group, they'd gain read access to other companies private addresses.

However, if you're not using private address (I've never seen anyone actually use them), you won't have any issues with turning these off.

Cheers,

Jake Robinson

That Record Rule causes a lot of problems! I think you will be fine to remove it.