Odoo Help

0

Prevent Duplication of Customers

By
Kitsikpui Elliot Elikplim
on 6/10/16, 6:28 AM 500 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
906
| 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!!!'))

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

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

Question tools

4 follower(s)

Stats

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