hello,
I am working on validation for leaves, my condition is if the start date of the leave less than the end of the trial period should raise a validation error, so I add a boolean field after the trial period
here is code:
@api.constrains('request_date_from')
def _check_trial_period(self):
print("jjjjjjjjjjjjj")
for record in self:
v = record.request_date_from > self.env['hr.contract'].search(
[('trial_date_end', ', record.request_date_from)])
if record.holiday_status_id.after_trial_period and v:
print("yyyyyyyyy")