Odoo Help


Prevent Duplication of Customers

Kitsikpui Elliot Elikplim
on 6/10/16, 6:28 AM 800 views

I'm trying to prevent users from creating duplicate customers, how can i do this for Odoo 8? 

Thank you. 

Is it ok to add unique constraint on customer name + email ?

Pinakin Nayi (pna)
on 6/10/16, 7:56 AM

Jusab Sida (jsi)

--Jusab Sida (jsi)--
| 2 2 5
Gandhinagar, India
--Jusab Sida (jsi)--

Jusab Sida (jsi)
On 6/10/16, 7:56 AM

Here is the example.

# An old way
def copy(self, cr, uid, id, default=None, context=None):
raise osv.except_osv(_('Warning!'), _('You are not allowed to duplicate this!!!'))


# for new api
def copy(self, default=None):
raise UserError(_('You are not allowed to duplicate this!!!'))


Thank you, Jusab.

Kitsikpui Elliot Elikplim
on 6/10/16, 7:58 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

4 follower(s)


Asked: 6/10/16, 6:28 AM
Seen: 800 times
Last updated: 6/12/16, 9:14 AM