Odoo Aide

0

0
3 Answers
0
Jerome Guerriat
21/03/2018 08:17

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.    


0
Avatar

Niyas Raphy

--Niyas Raphy--
24539
| 7 7 11
Wayanad, Inde
--Niyas Raphy--

Odoo Techno Functionalist

Feel free to connect :  niyasraphyk@gmail.com

Twitter:https://twitter.com/niyasraphy
LinkedIn: https://www.linkedin.com/in/niyasraphy/
FB:https://www.facebook.com/niyasraphy123

Happy to help :)

Niyas Raphy
20/03/2018 00:31

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

1 Commentaires
RDTRONIC, Silvère DERNOUH
20/03/2018 00:40

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.

Poser une question
Keep Informed
1 Abonné(e)s
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now