Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
5566 Lượt xem

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


Thank you. 



Ảnh đại diện
Huỷ bỏ

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

Câu trả lời hay nhất

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!

Ảnh đại diện
Huỷ bỏ
Tác giả

Thank you, Jusab.

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 12 23
1071
1
thg 11 21
7244
3
thg 8 20
5729
1
thg 6 20
2500
3
thg 12 19
9469