Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
5516 Vizualizări

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


Thank you. 



Imagine profil
Abandonează

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

Cel mai bun răspuns

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!

Imagine profil
Abandonează
Autor

Thank you, Jusab.

Related Posts Răspunsuri Vizualizări Activitate
0
dec. 23
1031
1
nov. 21
7158
3
aug. 20
5663
1
iun. 20
2441
3
dec. 19
9409