How can I configure Odoo SaaS to not create a duplicate contact based on a criteria (such as email)?
신고된 질문입니다
1
회신
3611
화면
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?
| 관련 게시물 | 답글 | 화면 | 활동 | |
|---|---|---|---|---|
|
|
0
4월 22
|
3544 | ||
|
|
3
9월 25
|
3328 | ||
|
|
1
3월 24
|
2805 | ||
|
|
2
8월 24
|
5021 | ||
|
|
1
1월 26
|
1003 |