Plan Orders
1. Order Overview
Plan orders represent a customer's configured subscription purchase before and after payment.
Fields
- Plan - Associated subscription plan (required, tracked)
- Period - Selected billing period (required, tracked)
- Subdomain - Customer's chosen subdomain (tracked)
- Full Domain - Computed:
subdomain.allowed_domain - Customer - Portal user / partner (tracked)
- Session ID - Browser session identifier
- Selected Packages - Chosen package lines (Many2many, tracked)
- Add-on Lines - Configured add-on quantities (One2many)
- Package Price - Sum of selected package prices (computed)
- Add-on Total - Sum of add-on prices (computed)
- Total Price - Package price + add-on total (computed)
- State - Order status (tracked):
Draft- Configuration in progressConfirmed- Order submittedPaid- Payment receivedDone- Subscription createdCancelled- Order cancelled
- Sale Order - Created sale order (tracked)
- Subscription - Created subscription (tracked)
- Currency - From plan
Add-on Lines
- Add-on - Reference to the plan add-on
- Quantity - Configured value (default: 0)
- 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):
action_after_payment()is triggered- System calls
action_create_subscription()asynchronously - 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
- Subscription is confirmed and queued for deployment
- 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 |