Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
5519 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
1033
1
Nov 21
7159
3
Agu 20
5663
1
Jun 20
2441
3
Des 19
9409