Skip to Content
Menu
This question has been flagged
3 Replies
2386 Views

I've created a wizard for adding companies to simplify the process for users. The user has all the correct permissions and can create a company from the company form view. 

But when I use the wizard it creates the company, creates the partner and fills it with the data for the custom fields but not the original fields (for address). The record in res_partner has the create_uid from the user that created it. But the user just can't change any data, because it just throws the Access Denied (Document type: Partner, Operation: write) error! I can even put the company to the users companies when the user has multi company enabled, but it doesn't fix the error.

Am I missing something? Can someone help?

Tried everything that I found on this forum and on stack overflow and nothing fixed this problem. I even tried to give all rights to access groups that are for res_partner model, but nothing helps. 

Avatar
Discard
Best Answer

Hello Samo,

User having multiple company access, so this case you have change current user company to the company which is mapped to res_partner. then it will work.

you can change the company from preferences menu




Avatar
Discard
Author

yeah... I thought that this might be the problem. I'm already rewriting my code to test this.

Author Best Answer

The problem is being caused by one of my access rules. The rule filters companies in the company menu. So that only the ones that are added to the user are shown. The access rule is [('company_id', 'in', [user.company_id.id])]. If I delete it the wizard works but everywhere were the company should be filtered by user it shows every company of every user. 

Avatar
Discard
Related Posts Replies Views Activity
2
Nov 24
25099
2
May 24
5524
3
Mar 24
4965
0
Mar 24
264
3
Feb 24
11421