Odoo Help

Welcome!

This community 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.

0

Prevent Duplication of Customers

By
Kitsikpui Elliot Elikplim
on 6/10/16, 6:28 AM 328 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
1

Jusab Sida (jsi)

--Jusab Sida (jsi)--
Tiny ERP Pvt Ltd
http://www.odoo.com
874
| 2 1 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!!!'))

And

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

enjoy!

Thank you, Jusab.

Kitsikpui Elliot Elikplim
on 6/10/16, 7:58 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

4 follower(s)

Stats

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