تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
5518 أدوات العرض

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


Thank you. 



الصورة الرمزية
إهمال

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

أفضل إجابة

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!

الصورة الرمزية
إهمال
الكاتب

Thank you, Jusab.

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
ديسمبر 23
1033
1
نوفمبر 21
7159
3
أغسطس 20
5663
1
يونيو 20
2441
3
ديسمبر 19
9409