Skip to Content
Menu
This question has been flagged
2 Replies
6960 Views

I using Odoo14,


I have users on my company, there is a cashier and there is an accountant,


I want  an accountant can Confirm and POST customer invoice.

And I want  a cashier don't have access to it (can't confirm and post invoice), but he can do Register Payment, but in the other hand, I also don't want accountant can do Register Payment.

the conclution:

  • Accountant can do Confirm and POST Invoice, but can't do Register Payment
  • Cashier can do Register Payment, but can't do Confirm and POST invoice

am trying to make security group like this:





and trying to inherit account.view_move_form view like this:



but I  can't  see  it  give any effect to Invoice button, I seem  it doesnt changes

the Cashier and and Accountant still look same.


So how to inherit button on a form and  updates  it   groups ?



Thanks,

Tri Nanda

Avatar
Discard
Best Answer

For Cashier and Accountant, should assign different User Groups. We can simply solving this issue through frontend while enabling developer mode. Go to Edit View: Form, then you can see the specified button's declaration, add the required group id. 

Eg, 

By this way we can restrict the buttons from different users.

Avatar
Discard
Author

Hi Sarath, thank you for your answer.

How to update the assigned groups on the button by code?

Thanks,
Tri Nanda

Hi Nanda, Enable the developer mode, then go to Settings-- Users & companies--- Groups. Export the required group by using boolean "I want to update data (import-compatible export). You have to select the Name filed to export. Thereby one file will download. Inside that file you will get an ID of that particular group. Then that ID you can add it on the code as i said.

Author Best Answer

I solved this problem with add index to the button name, because  I  have  multiple  button  with  same  name , 

the key is add index [1] or [2], etc.. if we have multiple button with same name.


like Waleed Mohsen answer in this thread: 

https://www.odoo.com/id_ID/forum/help-1/how-to-make-button-available-only-for-specific-group-of-users-131117#

Avatar
Discard
Related Posts Replies Views Activity
0
Dec 23
770
0
Sep 21
78
1
Sep 15
3678
2
May 24
1705
2
Mar 24
528