コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
5530 ビュー

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
12月 23
1042
1
11月 21
7170
3
8月 20
5673
1
6月 20
2448
3
12月 19
9424