Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
5562 Prikazi

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


Thank you. 



Avatar
Opusti

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

Best Answer

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!

Avatar
Opusti
Avtor

Thank you, Jusab.

Related Posts Odgovori Prikazi Aktivnost
0
dec. 23
1070
1
nov. 21
7221
3
avg. 20
5722
1
jun. 20
2489
3
dec. 19
9464