How can I configure Odoo SaaS to not create a duplicate contact based on a criteria (such as email)?
Cette question a été signalée
1
Répondre
3599
Vues
You can override create method like:
class Contacts(models.Model):
_inherit = 'res.partner'
@api.model
def create(self, vals_list):
email = vals_list.get('email', None)
if email:
partner = self.env['res.partner'].search([('email', '=', email)], limit=1)
if partner:
raise ValidationError('User already exists.')
return super(Contacts, self).create(vals_list)
Hello Arian,
Thank you for your response. I must mention that I am using Odoo SaaS. Do you have a solution for this version?
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrire| Publications associées | Réponses | Vues | Activité | |
|---|---|---|---|---|
|
|
0
avr. 22
|
3543 | ||
|
|
3
sept. 25
|
3321 | ||
|
|
1
mars 24
|
2800 | ||
|
|
2
août 24
|
5020 | ||
|
|
1
janv. 26
|
1000 |