Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
5580 Zobrazení

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


Thank you. 



Avatar
Zrušit

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

Nejlepší odpověď

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
Zrušit
Autor

Thank you, Jusab.

Related Posts Odpovědi Zobrazení Aktivita
0
pro 23
1081
1
lis 21
7300
3
srp 20
5774
1
čvn 20
2528
3
pro 19
9505