Skip to content

Trial Requests

1. Request Overview

Trial requests are submitted by potential customers through the public trial form and processed into subscriptions.

Fields

  1. Name - Contact name (required, tracked)
  2. Company Name - Customer's company (required, tracked)
  3. Email - Contact email (required, tracked)
  4. Mobile - Contact mobile number (required, tracked)
  5. Company Size - Employee count range (required, tracked):
    • 1-5, 6-10, 11-30, 30-100, 100+
  6. Trial Package - Associated trial package (required, tracked)
  7. Partner - Auto-created customer partner record (tracked)
  8. Subscription - Created subscription (tracked)
  9. Database Template - Database template override (optional)
  10. State - Request status (tracked):
    • New - Pending processing
    • Processing - Subscription being created
    • Done - Subscription created successfully
    • Cancelled - Request cancelled
  11. Notes - Internal notes

2. Request Lifecycle

New → Processing → Done
 ↓
Cancelled → New (reset)

3. Actions

Action Description
Create Subscription Manually create a subscription from this request
Cancel Cancel the request
Reset to New Reset a cancelled request back to New
View Subscription Open the related subscription
View Partner Open the related customer partner

4. Automatic Processing

When a request is created and the trial package has Auto Run Subscription enabled:

  1. A res.partner record is created (or linked if email already exists)
  2. A sadeem.subscription record is created with:
    • Customer = created partner
    • Packages = from trial package
    • User/storage/stage limits = from trial package
    • Trial duration and grace period
    • is_trial = True flag
    • Model limits (if configured)
  3. The subscription is confirmed and queued for deployment

Duplicate Prevention

Each email + trial package combination is unique. Submitting the same email for the same package will be rejected.


5. Email Verification (OTP)

A trial request is not created straight from the public form. The visitor first proves they own the email address.

Flow

sequenceDiagram
    participant V as Visitor
    participant W as Website
    participant O as sadeem.subscription.trial.otp
    participant R as Trial Request
    V->>W: POST /saas/trial/submit (form data)
    W->>O: Create pending verification + email a 6-digit code
    W-->>V: Code entry page (masked email)
    V->>W: POST /saas/trial/verify (token + code)
    W->>O: Hash and compare, check expiry
    O->>R: Create the trial request with the stored form data
    W-->>V: Confirmation page
Route Purpose
/saas/trial , /saas/trial/<url_string> Public trial form
/saas/trial/submit Stores the form data on a pending verification and sends the first code
/saas/trial/verify Validates the submitted code and creates the trial request
/saas/trial/resend Sends a fresh code for the same verification

The `sadeem.subscription.trial.otp` Model

  1. Contact Name, Company Name, Email, Mobile, Company Size, Trial Package - The pending form data, copied to the trial request once verified
  2. Access Token - Random hex token identifying the verification in the URL / form
  3. Code Hash - SHA-256 of access_token + code; the plaintext code is never stored
  4. Code Expiry - Timestamp after which the code is refused
  5. Failed Attempts, Codes Sent, Last Code Sent - Rate-limit counters
  6. State - Pending, Verified or Cancelled
  7. IP Address - Used for per-IP rate limiting
  8. Trial Request - Set once the verification produced a request

Limits

Limit Value
Code validity 10 minutes
Failed attempts per verification 5
Codes sent per verification 3
Resend cooldown 60 seconds
Verifications per email per hour 3
Verifications per IP per hour 10

One live verification per email + package

Starting a new verification cancels the other pending verifications for the same email and trial package, so an old code cannot be reused.

The code is delivered by the Trial OTP mail template (sadeem_subscription_trial.mail_template_trial_otp), sent immediately with force_send=True. If mail delivery is broken the visitor sees the failure at submit time rather than silently never receiving a code.