Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
5528 Widoki

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


Thank you. 



Awatar
Odrzuć

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

Najlepsza odpowiedź

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!

Awatar
Odrzuć
Autor

Thank you, Jusab.

Powiązane posty Odpowiedzi Widoki Czynność
0
gru 23
1040
1
lis 21
7167
3
sie 20
5671
1
cze 20
2447
3
gru 19
9423