Odoo SaaS Kit Documentation - Bytekol

1. What is Odoo SaaS Kit by Bytekol?

Like many other odoo SaaS Kit products on the market, Bytekol's Odoo SaaS Kit is a powerful toolkit of many odoo modules that help you deploy infrastructure management (servers, databases, server services, files management, ssh, ..) and create odoo entities (odoo database/odoo instance) quickly and save resources. At the same time, it also helps you sell Odoo Entities as subscriptions to customers.

Bytekol's Odoo SaaS Kit is designed with the following criteria:

  1. Powerful
  2. Best speed
  3. Secure
  4. Full of necessary features and many useful features
  5. Easy to maintain and expand
  6. Save and maximize server resources
  7. Continuously updated
  8. ...

2. Overview of modules

Odoo SaaS Kit is broken down into modules for easy maintenance, bug fixes, feature additions, and also helps buyers reduce costs by only purchasing the necessary modules.
Odoo SaaS Kit currently has the following modules:

  1. bk_infrastructure_base
    - This is the base module of odoo saas kit containing technical features and useful functions.
  2. bk_acme
    - The module integrates with free SSL certificate providers like Letsencrypt. It helps to get free SSL certificates automatically and easily, and it also helps to renew certificates automatically. SSL certificates are essential for website security.
  3. bk_odoo_entity
    - This is the most important module, also known as Odoo SaaS Kit, this module (and its dependent modules) helps to form a complete system in creating and managing odoo entities.
  4. bk_odoo_entity_custom_addons
    - Additional module for Odoo SaaS Kit, helps to add additional odoo source code for Odoo Entity from git remote (besides the standard source code of odoo server group)
  5. bk_odoo_entity_domain_name_advance
    - Additional module for Odoo SaaS Kit, helps to manage advanced domain names for Odoo Entity (add domain name, add customer domain name for odoo entity, ...)
  6. bk_odoo_entity_import_modules
    - Additional module for Odoo SaaS Kit, helps to install any 3rd party module (eg Odoo Appstore) by uploading (.zip file or download link) to odoo entity
  7. bk_odoo_entity_sale
    - Technical module for managing sales of odoo entities
  8. bk_odoo_saas_kit_pro
    - Module integrated with Odoo SaaS Kit (bk_odoo_entity) to sell odoo entities as Subscription, (bk_odoo_entity module itself does not have sales integration feature) With this module you can sell in many different forms such as apps, number of users, company resources, storage, plans, ... It has its own subscription system, independent of other subscription systems like Odoo EE, Subscription management feature is somewhat similar to Odoo EE, it provides better automation than bk_odoo_saas_kit_subscription_ee thanks to It also has "Customer Credit" feature (quite similar to e-wallet), so that sales on the website take place automatically.
  9. bk_odoo_saas_kit_subscription_ee
    - This is an Odoo EE source code only module, meaning you must have the Odoo EE source code to install this module. It integrates with the Odoo EE Subscription app and bk_odoo_entity to sell Odoo Entities as Subscriptions.
  10. bk_server_file_manager
    - This is a module integrated with bk_server_management to provide a user interface for managing files and folders (per server) right on Odoo.
  11. bk_server_management
    - Base module for managing resources.
  12. bk_server_webssh
    - This is a module integrated with bk_server_management to provide an SSH user interface on servers. It can open SSH sessions, track session history, used commands...

3. Terminology explained
  1. Odoo SaaS Kit
    Refers to the entire SaaS Kit system or a single module bk_odoo_entity
  2. Odoo Entity
    - Odoo Entity is also known as Odoo Instance or Odoo database (as odoo.com calls it). It is an entity that represents an Odoo database and is managed by Odoo SaaS Kit. An Odoo Entity will have its own default domain name created by SaaS Kit. It runs in an odoo container.
  3. Odoo Image
    Odoo Image in Odoo SaaS Kit is a model, and it is Docker Images on the server. Odoo Images will generate odoo containers with the same initial characteristics
  4. Odoo container
    - It is a docker container (running odoo-bin) and managed by odoo saas kit, there can be many odoo entities running in the same odoo container
  5. SSL certificate SSL certificates help to deploy https, help secure websites through https. In Odoo SaaS Kit, it is possible to manage multiple SSL certificates, automatically obtain/renew free SSL certificates from Letsencrypt, ...
    You can learn more about SSL and https certificates on Google.
  6. SSH Key
    SSH key consists of a pair of private key and public key. In odoo saas kit, it is used to connect to servers, access git remote (github, gitlab, ...) to get/update source code, ... SSH key is an important thing, so you need to keep your (private key) secure, Odoo SaaS Kit allows to assign access rights to SSH key records according to users.
  7. Server/Cloud Server.
    Server is simply understood as a computer. In the context of this article, server can be understood as VPS/cloud servers provided by server providers such as AWS and can be accessed via SSH.
    In Odoo SaaS Kit allows to manage many different servers. To work with Odoo SaaS Kit, the server needs to run Linux operating system (Ubuntu is recommended) and it must have 1 IP and Open-SSH installed to be able to access
  8. Odoo Server Group
    Is a collection of servers classified by functions such as nginx, docker, ... to be able to deploy odoo entities. An odoo server group can include many cloud servers or just 1 single server that installs applications such as nginx, docker.
    It can be said that Odoo Server Group is a "machine" that produces Odoo Entities with the same initial characteristics.
  9. Odoo CE (Odoo Community Edition)
    Odoo CE is also known as Odoo Source Code in Odoo SaaS Kit.
    Odoo CE repository at: https://github.com/odoo/odoo
    Odoo Source Code includes the code base and has an odoo-bin file to be able to launch an odoo database. Odoo Developers usually do not edit and develop features by directly editing the Odoo CE source code, but through creating odoo modules (odoo addons). Some people edit directly into the Odoo CE source code and call them by another name (for example: XYZ ERP) but it is still capable of launching odoo-bin and integrating odoo modules (addons), it is still called Odoo Source Code.
  10. Odoo EE (Odoo Enterprise Edition)
    Odoo EE is a folder containing the Odoo Enterprise source code of odoo.com (it is an odoo Addon).
  11. Odoo Addons (Odoo Modules)
    Odoo Addon is a folder containing odoo modules, odoo modules cannot be placed in subfolders. If it is used with git, the official branch name to use should follow the version of odoo: eg 17.0, 16.0, ...
    Example GitHub repository of an odoo addon: https://github.com/OCA/e-commerce
  12. Customer Credit
    As a model in Odoo saas kit pro module, it is like a customer wallet, it is used to pay for SaaS Kit products

4. How to install Odoo SaaS KIT

Odoo SaaS Kit includes many odoo modules written on the Odoo platform, so the way to install is to add the odoo saas kit modules to the addons_path configuration, like other odoo modules you download on the Odoo app Store. You need to have some IT knowledge to install, or at least you have installed some modules from Odoo App Store, if you don't know how to install, please contact us for help.

Note: Odoo SaaS Kit is tested on ubuntu server, so you also need to install them on Ubuntu, or linux servers, if you run under localhost and use Windows, you need to run Odoo SaaS Kit under linux virtual machine.
Odoo SaaS Kit also uses some python libraries, so you need to install libraries for it, all libraries of Odoo SaaS Kit modules are placed in the requirements.txt file of module bk_infrastructure_base:
bk_infrastructure_base
Install libraries for Odoo SaaS Kit the same way as installing libraries for Odoo. Eg:
/path/to/python3 -m pip install -r /path/to/bk_infrastructure_base/requirements.txt
After installing the library, access to your Odoo url, go to apps > click update apps list and search for Odoo SaaS Kit modules (starting with bk_) to install. Details about the features of odoo modules are explained in the documentation, and you can also find them in the Odoo app store.
4.1 Recommended server resources for installing odoo saas kit
Make sure the server running your odoo saas kit meets the following requirements:
  • Linux server like Ubuntu, for example Ubuntu 22.04 or Ubuntu 20.04.
  • At least 2GB RAM or more
  • at least 2 CPUs
  • 20GB storage or more
4.2 odoo.conf
find and open your odoo config file and edit the limit_time_real configuration:
limit_time_real = 18000
If limit_time_real is not present in the file, you need to add it at the end. The reason is that there are some tasks that take more time like backup or restore, or setup odoo server group.
4.3 Check your longpolling/websocket
Longpolling/websocket must be configured correctly (via odoo config file and nginx config file) for odoo saas kit to work properly.
To check if longpolling/websocket of your server running Odoo SaaS Kit is working, open 2 browsers and log in with 2 users, let them chat with each other, if the message is displayed real-time (no need to reload the page) then your longpolling/websocket is working properly. Otherwise, you should check your nginx/odoo configuration, if you need help, contact Bytekol.

5. Prepare resource for setup
5.1 Prepare a domain name
You can buy a domain name from any domain name provider, and can access its DNS record management panel. You need to own at least 1 domain name to be able to set up Odoo SaaS Kit, that domain name will be used as a subdomain for customer's Odoo Entities. For example, you bought a domain name bytekol.com, and want to use it for Odoo Saas Kit, then the customer domains would probably be:
  • customer1. bytekol.com
  • customer2. bytekol.com
  • entity1. cloud.bytekol.com
  • entity2. cloud.bytekol.com
  • ...
5.2 Prepare servers
You should buy at least 2 servers to start: 1 server for DNS and 1 server to host odoo entities. DNS server may only need 1, but servers for odoo entities may need to be purchased over time to be able to create more odoo entities.
However, to start (for testing), you can merge these 2 servers into 1. However, it is not recommended for real systems, the reason is that if the server is overloaded (usually due to increased access frequency to the odoo server), it will affect the DNS server, and many other reasons.
We don't have recommendations on server providers, but you should choose a server provider that can scale resources without having to create new servers. Recommended server resources are as follows:
  • Operating system: Ubuntu 22 or 20.04
  • 2GB RAM or more
  • 2 CPUs or more
  • 20 GB storage or more
  • Datacenter/Location: closest to where your target audience is
After purchasing the server, you need to make sure the server is accessible via SSH with root user by password or SSH key, and has opened ports 22, 80, 443, ... and ports from: 1000 and above. Odoo SaaS Kit uses port 1000 -> ... for some purposes such as Postgresql. And port from 10 000 to serve odoo entities.
5.3 Odoo Source Code
In this step, you need to visualize the source code used for Odoo Entities on your SaaS Kit system. Odoo SaaS Kit does not support creating multiple odoo entities through .deb files but installs them directly into the source code, which helps the server save a significant amount of storage resources and makes maintenance easier.

Odoo source code is divided into 2 main parts: Odoo CE source code and its additional addons source code (additional odoo modules). Normally, developers will extend the functionality of Odoo CE by developing additional odoo modules and usually do not directly edit the Odoo CE source code.

The most obvious example is Odoo SA. They use at least 2 source codes: Odoo CE and Odoo EE (including enterprise modules) for their customers. And all their customers use the same source codes.

Odoo SaaS Kit is designed so that you can provide odoo entities with different source codes. These source codes will be wrapped in an Odoo Server Group, with odoo server group you can create many odoo entities running on the source codes defined on it.

For example, you can create 4 odoo server groups on the same server as follows:
odoo server group 1 odoo server group 2 odoo server group 3:
  • odoo CE source code: https://github.com/odoo/odoo
  • odoo EE source code: ...
odoo server group 4:
  • odoo CE source code: (edited by a certain party)
Thus: Hopefully you have understood the difference between odoo source codes (including Odoo CE and additional addons) and setting up odoo server groups with different source codes will create odoo entities that share the same source code characteristics with it. Then what you need to do is standardize your source code for customers to be able to set up odoo server groups, your source code should be published on GitHub or Gitlab so that Odoo SaaS Kit can manage updates when there are changes. For addon source code (including additional modules), you must standardize them as follows:

  • The odoo modules are located in the same folder and not in any subfolders, for example:
correct:
your_custom_odoo_modules/
odoo_module1/
odoo_module2/
requirements.txt
...
incorrect:
your_custom_odoo_modules/
custom_sales/
odoo_module1/
odoo_module2/
custom_website/
odoo_module3/
odoo_module4/
requirements.txt
...
To summarize in this part, you need to know which sources code you use for customers and convert them into addons and put them on github or gitlab.
5.3 SSH Key
If you don't know or have never used SSH Key, don't worry, and here you don't need to do anything, because the setup video below has instructions on how to create SSH Key on Odoo SaaS Kit.
SSH includes 1 public key file and 1 private key file. You can learn more about SSH Key on Google. You need at least one SSH key (including 1 private key file and 1 public key file). And make sure to deploy that public key to your GitHub or Gitlab.
To deploy the public key to your GitHub account. Click on Avatar > Setting > SSH and GPG Key > New SSH Key> then fill in the content of the public key file into the form.
github ssh key

6. Setup servers and launch an odoo entity
The setup process is generally quick, taking only about 30 minutes -> 1 hour, however for newbies, this process may take longer. The instructions above are to check and prepare everything necessary to be able to set up. In this section, we will set up 3 Odoo Server Groups and some SaaS Domain Names so you can visualize how the system works.
The instructions will be step by step.
Make sure you have everything in step 5. Let's say we have the following:
2 Servers:
  • Server 1 (for Odoo Server Group):
    • IP: 98.130.45.73
    • OS: Ubuntu 22
    • RAM: 2GB
    • CPU count: 2
    • Storage: 20GB

  • Server 2 (for DNS Server):
    • IP: 18.61.163.73
    • OS: Ubuntu 22
    • RAM: 2GB
    • CPU count: 2
    • Storage: 20GB

1 domain name: bytebype.online

Odoo Source Code and Odoo Addons. (Has been uploaded to GitHub)
Actually it may not be necessary to upload to GitHub, but in this tutorial I will use GitHub because it is extremely convenient. When you upload your source code to GitHub, you need to pay attention to the LICENSE of the source code. Some source codes must be public and some must be private, but some can be private or public at will. The video setup guide is below, here we will summarize the content and steps.
  1. Create/Upload an SSH Key on Odoo and push to GitHub:
  2. Create 2 Servers, Test connection
  3. Set up an Odoo Server Group
    (If there is an error, try restarting the server by click the "Restart" button on the server and try again a few times.)
  4. Create a SaaS Domain Name ...
  5. Launch first odoo entity
  6. Create new Ooo Server Groups and Launch odoo entities with difference Odoo Server Group
  7. Find Odoo Modules, Launch an Odoo Entity on the website.
Transfer the Nameserver to the new DNS server can take up to 48h to complete, but it can also take only about 30 minutes. You can do the Setup SaaS Domain Name step in parallel while waiting for the Setup Odoo Server Group to save time.

7. Sale Management
Sales management in Odoo SaaS Kit is Subscription based. There are 2 main modules in Odoo SaaS Kit to manage sales with 2 different Odoo Entity sales types:
  • Subscription & Customer Credit [bk_dooo_saas_kit_pro]
  • Subscription (Odoo Enterprise) [bk_odoo_saas_kit_subscription_ee]
The above 2 modules provide 2 different sales models. The difference between the 2 sales models is not much, both are based on Plan and Subscription. While bk_dooo_saas_kit_pro provides wallet-like features and better automation features, it is also more difficult to use. Meanwhile, bk_odoo_saas_kit_subscription_ee is based on Odoo Enterprise's Subscription application, so sales management is completely based on the Subscription application, the revenue management and reporting features are also good, which will be easier for most people who have used it.
You can set up sales types outside the website by going to Setting > Website > Odoo Entity Sale Type

To convert an Odoo Entity to a paid subscription, you just need to create a subscription, confirm, then create Odoo Entity, select the corresponding customer, sales type and corresponding Subscription, the end date of Odoo Entity is based on the end date of Subscription. When the end date passes, Odoo Entity will be disabled (temporarily inaccessible). If the subscription has expired and the customer does not want to continue using it, you can cancel odoo entity to permanently delete the data.

The two sales types in the two modules do not have much difference, they are both based on Subscription, there is Renewal, Upselling, ... Some features will be guided in section 8: Operating Instructions. We are updating the documentation for sales feature, if you have any questions about the feature, please contact Bytekol.

8. Operating Instructions
  1. Update source code for odoo entities
    If there are changes to the source code and you need to update them for odoo entities, if you use git, you can update the source code in many ways on Odoo SaaS Kit: - Via Odoo Server Group
    - Via Odoo Entity
    - Via Odoo Container
    ... Source code for odoo entity has 2 types: shared and dedicated, when updating the shared source code, it will affect all odoo entities using it, so please pay attention to it.
  2. Upgrade odoo module for odoo entity in case necessary
    If you need to upgrade the module when changing the source code, you can use the module upgrade feature on the odoo entity view form
  3. Backup & Restore
    In some cases you need to back up and restore the database for customers. Currently, there is no automatic backup feature. For a large number of odoo entities, you may need the automatic backup feature.
  4. Expand workers, change odoo config
    You will probably need to change the worker on the odoo container to accommodate the number of concurrent users. Information about workers:
    https://www.odoo.com/documentation/17.0/administration/on_premise/deploy.html#worker-number-calculation Odoo SaaS Kit helps you change the configuration running right on the interface in the odoo container.
  5. Convert from Trial to paid
    Click the Update Plan button on Odoo Entity, note that you need to create a subscription for the customer in advance. After updating the plan, Odoo Entity will also be updated with resource limit information (client data) such as installed odoo modules limit, number of users, companies, etc.
  6. The customer wants to add his own domain name
    Can be done through Odoo Entity view form by Add new domain button (need to install module bk_odoo_entity_domain_name_advance)
  7. Customers want to use odoo modules from 3rd parties
    Can be done through Odoo Entity form view (module: bk_odoo_entity_custom_addons and module bk_odoo_entity_import_module)
  8. Customers want to buy more/reduce the number of users, subscription products, change cycles, or switch plans
    can be done through the renew feature on subscription
  9. Create more Odoo Server Group

    You will need to create more Odoo Server Groups to balance the load when Odoo Entities become more, please limit the number of Odoo Entities running on odoo server groups, its value depends on the CPU and RAM configuration of the server and The number of users accessing simultaneously on odoo entities, currently there is no specific formula, so please monitor the server's resources to be able to calculate an appropriate number.

    To create a new Odoo Server Group, you can quickly create it with the Odoo Server Group setup button on the server record. Currently, you should only use it once (when successful) on each server. You can also create a new odoo server group by combining existing nginx servers, odoo images, postgresql instances, and backup servers.

  10. ...

9. Change Logs
Version: 1.0.1
  • Many user interface improvements, adding some useful functions
  • Fix known bugs
  • DNS Record Management Feature in Bind9zone
  • Easily get/renew free SSL certificates from Lensencrypt automatically.
  • Improved Odoo Server Group setup, faster and more convenient than before
  • Many changes in odoo saas kit pro:
    • Improved subscription makes it easier to use, renewal and upselling work quite similar to Odoo EE.
    • FIX: When you top up "Customer Credit" on the website, it will not create a sales order, but will record the payment.
    • Subscription allows for a variety of products, and one-time purchases can be paid for with customer credit.
Version: 1.0.0
First version