Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
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 ?
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)
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 E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 4/3/15, 6:08 AM|
|Seen: 1104 times|
|Last updated: 4/3/15, 6:26 AM|