Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
5726 Tampilan

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


Thank you. 



Avatar
Buang

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

Jawaban Terbai

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
Buang
Penulis

Thank you, Jusab.

Post Terkait Replies Tampilan Aktivitas
0
Des 23
1290
1
Nov 21
7471
3
Agu 20
6005
1
Jun 20
2686
3
Des 19
9753