I want to prevent the creation of a record in the database if the first condition is met what should i return in that case.
Thanks in advance everyone
def create(self,vals):
elv=self.env['gbv_elv'].browse(vals.get('eleveur'))
for verif in elv.verif:
last=verif
if((datetime.today().date())-last.date).days < 180:
print('hamborg')
else:
print('no hamborg')
print(((datetime.today().date()) - last.date).days)
ok=vals.get('ok')
elv.last_date=datetime.today()
if ok:
elv.rate='high'
else:
elv.rate='low'
return super(verifacation,self).create(vals)