Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
5520 Vistas

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


Thank you. 



Avatar
Descartar

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

Mejor respuesta

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

Thank you, Jusab.

Publicaciones relacionadas Respuestas Vistas Actividad
0
dic 23
1033
1
nov 21
7159
3
ago 20
5663
1
jun 20
2441
3
dic 19
9409