What I have tried to do is that if the specialist_name is empty, I have to raise a Validation Error. But it is not working. What am I doing wrong? My python code is below:
specialist_name = fields.Many2one(
'res.partner',domain=[('is_specialist','=',True)],string="Specialist")
@api.constrains('specialist_name')
def _onchange_value(self):
if self.specialist_name == False:
raise ValidationError(_('Only The Specialist Has The Provision To Create'))