How can I configure Odoo SaaS to not create a duplicate contact based on a criteria (such as email)?
この質問にフラグが付けられました
1
返信
3595
ビュー
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
|
3543 | ||
|
|
3
9月 25
|
3321 | ||
|
|
1
3月 24
|
2800 | ||
|
|
2
8月 24
|
5020 | ||
|
|
1
1月 26
|
1000 |