Skip to Content
Menu
This question has been flagged
1 Odpoveď
5560 Zobrazenia

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


Thank you. 



Avatar
Zrušiť

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

Best Answer

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
Zrušiť
Autor

Thank you, Jusab.

Related Posts Replies Zobrazenia Aktivita
0
dec 23
1070
1
nov 21
7219
3
aug 20
5716
1
jún 20
2483
3
dec 19
9461