I needed to hide the 'duplicate' option for a specific object. I resolved this programmatically by inheriting the 'copy' method as follows:
def copy(self, cr, uid, id, default=None, context=None):
raise osv.except_osv(_('Warning!'),_("Duplicate is not allowed"))
I need to enhance this by hiding this options from the 'more' options button, how can I do that?
======
After I did my solution, I checked again and found this link, I followed the same reasoning. But I need a solution by using groups and rules similar to this one, this is more elegant.
The Dynamic Duplicate Menu Hider for Odoo 17 is an essential tool for enhancing your Odoo instance's user interface by dynamically managing the visibility of the duplicate action menu button in both list (tree) and form views. This app allows administrators to configure the visibility of the duplicate action menu button based on user groups and specific model configurations, ensuring a streamlined and customized user experience. With an easy-to-use configuration panel, you can quickly toggle the visibility of the duplicate menu for selected models, empowering you to maintain a cleaner and more controlled interface. Integration is achieved through the use of the js_class attribute in both list (tree) and form views.
https://www.youtube.com/watch?v=VbZ0tptaq0Y