Subscription Integration
1. Subscription Fields
The DB Filter module extends
sadeem.subscriptionwith deployment-specific fields.
- Subscription Type - Set to
DbFilter - DB Filter Server - Assigned server (tracked, readonly after draft)
- DB Filter Server Group - Server group for auto-selection (tracked)
- Subscription Password - Auto-generated 6-digit admin password (readonly)
2. Deployment Flow
Server Group → Best Server → Create Database → DNS/Nginx → Running
- When the Server Group field changes, the system calls
get_best_server()to auto-populate:- DB Filter Server, Server IP, HTTP/WebSocket ports
- Main domain, subdomain prefix
- Cloudflare settings (if enabled on server)
- Nginx server and certificate
- Odoo version
- On Run Subscription, the system:
- Generates a 6-digit random admin password
- Sends a POST request to the server's create database endpoint
- Creates the Cloudflare DNS record and Nginx proxy host
- Transitions to Running state
Template Mode
If a Database Template is set on the subscription, the system skips the standard database creation API call and instead uses the template restore mechanism from the parent module.
3. Automatic Creation from Invoices
When an invoice containing SAAS DB Filter products is posted, subscriptions are created automatically.
- Invoice is posted with
create_saas_subscriptionflag - System identifies products where
saas_service = Trueandsaas_subscription_type = dbfilter - Creates one combined subscription for all SAAS products in the invoice
- Merges all
saas_packageIDs from all products (deduplicated) - Uses the product's
dbfilter_saas_server_groupto select the best server - Confirms the subscription and queues
action_run_subscription()asynchronously - Posts success/failure messages to the invoice chatter
4. Product Configuration
Products can be configured as DB Filter SAAS services.
- SAAS Service - Mark as a SAAS product (Boolean)
- Subscription Type - Set to
DbFilter - DB Filter Server Group - Server group for auto-assignment (required for DB Filter type)
5. Portal Extension
The customer portal is extended with a Connect As feature that allows customers to retrieve login credentials and access their DB Filter subscription directly.