Skip to Content
Menu
This question has been flagged
1 Atsakyti
5577 Rodiniai

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


Thank you. 



Portretas
Atmesti

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!

Portretas
Atmesti
Autorius

Thank you, Jusab.

Related Posts Replies Rodiniai Veikla
0
gruod. 23
1079
1
lapkr. 21
7290
3
rugp. 20
5747
1
birž. 20
2526
3
gruod. 19
9500