Skip to Content
Menu
This question has been flagged
4 Replies
3892 Views

I want to make the users who are registered as employees, see only their OWN invoices, shared invoices with them created by them, and restrict the rest of the existing invoices that are NOT created by themselves or shared with them.


How can I do this? I've tried by giving security rule but it's still showing. I am using odoo 16. I am using free self hosted version



Avatar
Discard
Best Answer

Hi Havishka.

You can restrict users to see only their own invoices by setting up record rules. Here’s a general idea of how you can set this up:

  1. Go to Settings: Navigate to the settings menu and then to the technical settings. Under the security tab, you will find the option for Record Rules.
  2. Create a New Record Rule: Click on “Create” to set up a new record rule. Set the object field to “Invoices” or the appropriate model you are working with.
  3. Define the Domain Filter: In the domain field, define the domain filter to restrict the invoices. The domain should ensure that only the invoices belonging to the current user are visible. For example, you can use the create_uid field to filter invoices based on the current user. The domain filter could look something like this: [('create_uid', '=', user.id)].
  4. Apply the Rule to the Appropriate User Groups: In the groups field of the record rule form, select the user groups to which this rule should apply.

Hope it helps somehow.


Avatar
Discard
Best Answer

Hi,

You can set record rules to achieve thisexample:In the below image you can see all the invoices


Now lets try to add record rules
1) Settings -> Technical -> Security -> Record rulesCreate new rule


choose the model journal entry(account.move)and domain filter ['|', ('user_id', '=', user.id), ('create_uid', '=', user.id)] 2) Open invoicesNow you can see that the record rule is applied for the invoices


You can change the domain filter  accordingly


Hope it helps

Avatar
Discard

This is a global rule that will apply to all users for all journals. That will work, but it seems very restrictive!

Best Answer

If you have the sales app installed, there are two Record Rules that grant access to:

  1. All invoices and credit notes for the group Sales / All Documents
  2. Sales / Own Documents Only can only see their own invoices and credit notes

If you want to limit access for all sales users you can adapt these Record Rules (as described here).

Also:

  • If these users are members of the Invoicing / Billing group they will have access to all Journal Entries, including sales invoices.
  • There is also a technical group Show Accounting Features - Read Only that would grant Read access to all Journal Entries

Adding a new (non-global) Record Rule can never limit access, so you have to check what other Rules apply and make changes either to the Rule or the user profile.

Avatar
Discard
Best Answer


Try this users can see the entries created by him..\

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

Avatar
Discard
Related Posts Replies Views Activity
4
Aug 25
156
1
Aug 25
101
1
Aug 25
721
1
Aug 25
423
2
Aug 25
1614