Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
5572 Visninger

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


Thank you. 



Avatar
Kassér

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

Bedste svar

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
Kassér
Forfatter

Thank you, Jusab.

Related Posts Besvarelser Visninger Aktivitet
0
dec. 23
1076
1
nov. 21
7265
3
aug. 20
5739
1
jun. 20
2518
3
dec. 19
9481