This question has been flagged
3 Replies
6186 Views

Hi,

In the Subscriptions Module, I wish to hide the EDIT button for a specific group in the form sale_subscription.sale_subscription_view_form.

And only for this module, only for this form, only for this group.

Could anyone could explain the main lines to resolve that as it seems to be out of the Form View ?

Thanks

Avatar
Discard
Best Answer

I suppose you could use some javascript to hide the button under specific condition.

Another way would be to inherit the write() method and do you check inside it. You wouldn't hide the 'edit' button but you could block the users from editing the object.    


Avatar
Discard
Best Answer

Hi,

For this what you have to do is that create a access rights for this. Either you can do it from the UI or from the code. See the sample to see how it can be done from the code.


id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
id_for_this,a_name_for this,module_name.model_model_name,your_group_name,1,0,0,0

Above is a general case,

see a sample with the model sale.order for the group named test_group

id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
sale_test_group_access,sale.test.group.access,sale.model_sale_order,test_group,1,0,1,1


Once you have applied this access right, the users in group test_group will not see edit button for the model sale.order


You can create file inside security folder with the name ir.model.access.csv and mention this in manifest file


Thanks

Avatar
Discard
Author

Thanks for this but the problem is that ta the smae time I need to make visible the attachment button on the top.

If on model Sale Subscription, I delete the perm_write, I hide the EDIT button but also the Attachment button.