Odoo Help


Hide duplicate option on "More Options" selection, on form view

Yassine TEIMI
on 4/3/15, 6:08 AM 1,559 views

I want to grant a user the create right on model crm.claim, but I don't want him to duplicate his claim. So on the more options tab, I want to hide "Duplicate", when the user is on the form view.

I know there is a relationship between the acess rights, and the options displayed on the More options selection, so, I'm trying to grant the create right without the duplicate right. How can I do it ?

Odoo For Beginners
On 6/14/17, 1:40 PM

Take a look at this blog 

How to hide an options from 'More' button?

Atchuthan - Technical Consultant, Sodexis Inc

--Atchuthan - Technical Consultant, Sodexis Inc--
| 5 5 8
Puducherry, India
--Atchuthan - Technical Consultant, Sodexis Inc--
Passionate coder in Python/Odoo(formerly known as OpenERP).

Contact me via GMail: atchuthantu@gmail.com via Skype: atchuthan_skype
via Linkedin: http://in.linkedin.com/in/atchuthantu
Atchuthan - Technical Consultant, Sodexis Inc
On 4/3/15, 6:26 AM

With only access rights, it is not possible to hide "Duplicate" button in more.  Instead you could try to raise an error when the user containing a particular group does duplicate.

    def copy(self, cr, uid, id, default=None, context=None):
        if self.pool.get('res.users').has_group(cr, uid, 'MODULE_NAME.YOUR CUSTOM GROUP ID'): # e.g. base.group_sale_manager
            raise orm.except_orm('Error', 'You cannot duplicate this record')
        return super(crm_claim, self).copy(cr, uid, id, default, context=context)

It's great on the python side, is there any similar solution, on XML side, like hiding the other options button, when a form view is loaded ? could it be done by xml or javascript ?

Yassine TEIMI
on 4/3/15, 8:03 AM

Hi, currently not in xml, button Duplicate is defined in javascript and depends create rights, see : addons/web/static/src/js/view_forms.js : self.is_action_enabled('create') && { label: _t('Duplicate'), callback: self.on_button_duplicate }, you should override this javascript file for that. Bye

Cyril Gaspard (GEM)
on 4/4/15, 8:57 AM

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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 4/3/15, 6:08 AM
Seen: 1559 times
Last updated: 6/14/17, 1:40 PM