Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
5756 Ansichten

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


Thank you. 



Avatar
Verwerfen

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

Beste Antwort

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
Verwerfen
Autor

Thank you, Jusab.

Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Dez. 23
1327
1
Nov. 21
7502
3
Aug. 20
6047
1
Juni 20
2713
3
Dez. 19
9791