Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
5524 Weergaven

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


Thank you. 



Avatar
Annuleer

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

Beste antwoord

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
Annuleer
Auteur

Thank you, Jusab.

Gerelateerde posts Antwoorden Weergaven Activiteit
0
dec. 23
1040
1
nov. 21
7166
3
aug. 20
5665
1
jun. 20
2445
3
dec. 19
9419