Skip to content

Plan Orders

1. Order Overview

Plan orders represent a customer's configured subscription purchase before and after payment.

Fields

  1. Plan - Associated subscription plan (required, tracked)
  2. Period - Selected billing period (required, tracked)
  3. Subdomain - Customer's chosen subdomain (tracked)
  4. Full Domain - Computed: subdomain.allowed_domain
  5. Customer - Portal user / partner (tracked)
  6. Session ID - Browser session identifier
  7. Selected Packages - Chosen package lines (Many2many, tracked)
  8. Add-on Lines - Configured add-on quantities (One2many)
  9. Package Price - Sum of selected package prices (computed)
  10. Add-on Total - Sum of add-on prices (computed)
  11. Total Price - Package price + add-on total (computed)
  12. State - Order status (tracked):
    • Draft - Configuration in progress
    • Confirmed - Order submitted
    • Paid - Payment received
    • Done - Subscription created
    • Cancelled - Order cancelled
  13. Sale Order - Created sale order (tracked)
  14. Subscription - Created subscription (tracked)
  15. Currency - From plan

Add-on Lines

  1. Add-on - Reference to the plan add-on
  2. Quantity - Configured value (default: 0)
  3. Price - Computed from add-on pricing for the order's period

2. Order Lifecycle

Draft → Confirmed → Paid → Done
                      ↓
                  Cancelled

3. After Payment

When the linked sale order is confirmed (payment received):

  1. action_after_payment() is triggered
  2. System calls action_create_subscription() asynchronously
  3. Subscription is created with:
    • Customer = order partner
    • Domain = full domain
    • Packages = selected packages
    • Resource limits from add-ons (storage, users, stages)
    • Subscription type and deployment settings
  4. Subscription is confirmed and queued for deployment
  5. Order state transitions to Done

4. Actions

Action Description
View Subscription Open the created subscription
View Sale Order Open the linked sale order
Cancel Cancel the order