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
2105 Widoki

How can I configure Odoo SaaS to not create a duplicate contact based on a criteria (such as email)?

Awatar
Odrzuć
Najlepsza odpowiedź

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)


Awatar
Odrzuć
Autor

Hello Arian,

Thank you for your response. I must mention that I am using Odoo SaaS. Do you have a solution for this version?

Powiązane posty Odpowiedzi Widoki Czynność
0
kwi 22
2363
2
gru 24
1208
1
mar 24
1347
2
sie 24
3600
2
lip 25
2604