Simple SAAS Documentation

How to install and configure simple SAAS module



Before we start Please prepare this requirements


  • Make sure you have root access to your servers
  • Install your required odoo version on master and slave servers 
  • Download dx_saas_dbfilter and dx_users_modules_control


The documentation will be divided into two parts


  1. Install and configure module on slave server
  2. Install and configure module on master server



Slave server


Download module dx_users_modules_control choose correct version for your odoo version

  1. Decompress file
  2. Open extracted directory and open file  "config.json" with your favorite text editor
  3. Change enabled to "True" Please copy it because it is case sensitive
  4. Change backend value to your odoo master URL
  5. Save file and compress directory again




Prepare requirements


All steps are required module wont work without this


  1. Install nginx (apt/yum install nginx)
  2. Upload modified "dx_users_modules_control" to your odoo installation addons directory
  3. Add this parameter to your odoo installation configuration file (dbfilter = ^%h)
  4. Restart your odoo service

Optional step


if you plane to use letsencrypt certifications please install this package

wget -O - https://get.acme.sh | sh

After this

 

/root/.acme.sh/acme.sh --set-default-ca --server letsencrypt


Your client/slave server is ready now



Master server


All steps are required module wont work without this

Prepare requirements


  1. Install paramiko python package (pip install paramiko)
  2. Install curl (apt/yum install curl)
  3. Upload (dx_saas_dbfilter) to your odoo installation addons directory
  4. Restart your odoo service



Install module


  1. Enable developer mode on - Go to settings and navigate down then press Activate the developer mode
  2. Go to Apps menu and press Update Apps List Then press Update
  3.  Search for "dx_saas_dbfilter" then click Activate/Install
  4. After install module give your user required permission for managing SAAS module



Your are now ready to configure your server



Configure Module


After install module successfully and get required permission refresh page to see new installed module

 1- Open module menu



2-  Configure module settings

Go to >> Configuration/Settings

Settings menu

  1. Setting menu
  2. Grace period for ended subscription 
  3. Enable auto creating SSL certfication for newly purchased SAAS service via website
  4. Domain start for new subscription purchased via website if registered user company or name is not in Latin character


3-  Configure Versions

Go to >> Configuration/Odoo Versions

Create new record for your versions

Versions menu

  1. Odoo Versions Menu
  2. Your version number


4-  Configure Versions

Add modules name to group theme in packages after this

Go to >> Configuration/Module

Create new record for your modules

  1. Modules menu
  2. Technical name for module you want to install on your clients database
  3. Your module description


If you would your client to be able to install any module without limitation add a module with name "all" and add it to your package

Adding module "all" will not install modules on clients database automatically



5-  Configure Packages

This helps you organize your modules in packages to sell it easily

Go to >> Configuration/Packages

Create new record for your packages

  1.  Packages menu
  2. Your package name
  3. Modules included in this package


After completing this steps you are ready to add your first server

Add your first server

Go to >> Servers Menu Click new button to create server


  1. Servers menu
  2. Confirm button
  3. Server name
  4. URL protocol
  5. Your server URL without protocol
  6. Master database password for this server
  7. Public HTTP port
  8. Local port for your odoo installation if your odoo installation is behind and proxy like Nginx
  9. Longpolling port as defined in your odoo configuration file
  10. Domain used for newly created subscription on this server
  11. Odoo version
  12. Odoo variant
  13. SSH user name
  14. SSH password
  15. SSH port
  16. Country of server
  17. State of server
  18. Custom database routes if your are using non standard routes
  19. Custom nginx directories if you are using non standard directories


Created server is in draft state which mean that it will not be visible in servers field when creating new subscription


After confirming server you are ready not to move to next step Adding your first subscription


Add your first client subscription

 Go to >> Subscriptions Menu Click new button to create subscription



  1. Subscriptions Menu
  2. Confirm button
  3. Your client
  4. Create subscription on this server
  5. Subscription domain
  6. Package
  7. Users count
  8. Login -it generated using client email and if no email it will be admin
  9. Password - random password
  10. Start date
  11. End date
  12. Create SSL certification
  13. Subscription State

Make sure that you have created DNS record for your subscription domain 

If every thing is OK you can now confirm this subscription and move to next step


Create subscription database

After confirming subscription a new buttons will be visible


  1. Create Database
  2. Cancel subscription
  3. Subscription state


Install Subscription modules

After press Create DB creating database process will be sent to clients/slave server

 After creating database it will install modules defined in package automatically

If It failed in any step a button for field step will be shown




  1. Stop Database
  2. Install modules on client database - This button will be visible if it failed to install it when creating database 
  3. Cancel subscription - Be aware that this action is not reversible and it delete client database
  4. Download backup of this database 
  5. Send subscription details to customer via email
  6. Subscription state
  7. Log with failed action


Reinstall subscription modules


After press install modules A success message is logged and Install modules button is now shown anymore


Send details to client

Wizard to send details to customer email



Please note that this details is automatically sent to client after creating database without press this button