This question has been flagged
6 Replies
3966 Views

I want to create a group to Accounting with the purpose of make the users that are in that group, let them see only their OWN invoices, created by them, and restrict the rest of the existing invoices that are NOT created by themselves.


I want to apply this to INVOICES and BILLS


How can I do this? I've tried by creating and adding a group to Accounting and adding some Record Rules like [('user_id','=',user.id)] but it only works for invoices, not for bills.


UPDATE: 

The invoices are working, I can only see the invoices that the user creates, but the main problem is that I can see everyone's bills.


This is my group configuration (these are the links of the screenshots) :

https://postimg.cc/nCnYKQ9K
https://postimg.cc/v4BrkFzc
https://postimg.cc/GHzPXhvW
https://postimg.cc/62sC87Nv
https://postimg.cc/xkNKjvBQ
https://postimg.cc/34gmmKKb
https://postimg.cc/K1HPyqqQ


And this is what the user sees:

https://postimg.cc/1fNB3ZF2
https://postimg.cc/gr74p0x3
https://postimg.cc/tZSkYq2Q


Thanks in advance.


Avatar
Discard
Author Best Answer

I have found a solution. Maybe it's not the perfect answer for this problem but I hope it works for somebody that haves or will have this issue:


https://postimg.cc/k683Wtz2

https://postimg.cc/gLqCTbYd

https://postimg.cc/tnj0k4G2

https://postimg.cc/qgsHRy2Y

https://postimg.cc/DSz9BNRk

https://postimg.cc/56fdFy3t

https://postimg.cc/jLvV6Tg4


I've created a new group, and applied this rules and right accesses. Doing this you are allowing an specific user only to see the Accounting app, and making him only aviable to see his OWN invoices and bills. And he can read, create, update and delete them.

Avatar
Discard
Best Answer

Hello,

you can add a `record.rules` with domain filter ['|',('user_id','=',user.id),('user_id','=',False)]

Avatar
Discard
Author

Thanks for your answer, I updated the post adding some screenshots, because I'm having troubles with bills.

Best Answer

Hello Gabri, 

I think you have to try this domain in your record rule. 

[('create_uid', '=', user.id)]

Hope this domain is helpful to you. 

Avatar
Discard
Author

Thank you so much for your answer, it is working for invoices, but I don't understand why is not applying aswell for bills (vendor bills). I've added some screenshots to give examples .

Best Answer

Hello,

You should check the access rights/record rules of the user to see if he inherits one from another group for the account.move and account.move.line model.

I had a similar issue with the accounting app where the user told me he still had access to the vendor bills but not to the invoices.

Avatar
Discard
Best Answer

You can try to put users in the group "Sales: own documents only".  There are several record rules that I think correspond to what you are looking for. 
Maybe you have to create some rules for invoices.

Avatar
Discard
Best Answer

Has anyone found a solution to this yet? I get the same results, the record rules apply to the invoices but not the vendor bills

Avatar
Discard