Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
5571 Näkymät

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


Thank you. 



Avatar
Hylkää

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

Paras vastaus

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
Hylkää
Tekijä

Thank you, Jusab.

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
jouluk. 23
1076
1
marrask. 21
7262
3
elok. 20
5738
1
kesäk. 20
2517
3
jouluk. 19
9478