(self)
It will not allow birthdates in the future.
It will not allow birthdates in the future.
It will not allow birthdates in the future .
def _check_birthdate_date(self):
        """ It will not allow birthdates in the future. """
        now = datetime.now()
        for record in self:
            if not record.birthdate_date:
                continue
            birthdate = fields.Datetime.from_string(record.birthdate_date)
            if birthdate > now:
                raise ValidationError(_(
                    'Partners cannot be born in the future.',
                ))
def _check_birthdate_date ( self ) : now = datetime . now ( ) for record in self : if not record . birthdate_date : continue birthdate = fields . Datetime . from_string ( record . birthdate_date ) if birthdate > now : raise ValidationError ( _ ( 'Partners cannot be born in the future.' , ) )