In the case that the customer already exists and the Salesperson is the same user, but he does not complete the creation process and shows a message that the customer already exists.
whats the code i do it
note i inhert selection field (red,orange,green)
this is case in red
@api.constrains('website')
def _check_validation(self):
if self.website:
res = self.search([('website', '=', self.website), ], limit=1)
if res:
raise ValidationError(_("Website Must Be Unique."))