How can I configure Odoo SaaS to not create a duplicate contact based on a criteria (such as email)?
Це запитання позначене
1
Відповісти
3629
Переглядів
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?
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Реєстрація| Related Posts | Відповіді | Переглядів | Дія | |
|---|---|---|---|---|
|
|
0
квіт. 22
|
3545 | ||
|
|
3
вер. 25
|
3335 | ||
|
|
1
бер. 24
|
2817 | ||
|
|
2
серп. 24
|
5023 | ||
|
|
1
січ. 26
|
1013 |