In this documentation, you will see the flow of Odoo v12 SaaS along with their configuration so let’s proceed.
Technical Odoo v12 SaaS setup
Configure Odoo SaaS installation:
- Set dbfilter in the config file or run odoo with –db-filter parameter, e.g. ^%h$
○ be sure, that you don’t use db_name in the config file and don’t run odoo with -d (–database) parameter
○ check odoo documentation for understanding DB filter and database parameters.
- Execute commands below to allow create databases with dots in the name:
cd path/to/odoosed -i ‘s/matches=”[^”]*”//g’ addons/web/static/src/xml/base.xml
○pip install oauthlib
○pip install requests –upgrade
Create two databases (via /web/database/manager):
- Main Database: For example .: * install saas_portal and saas_portal_* (optional) modules
- Server Database: For example .* install saas_server
Configure Server Database * Activate the developer mode via “(?)/About” menu at the top right-hand corner * Open Settings/Users/OAuth Providers – SaaS
- Click [Edit]
- Then update domain name at “Authentication URL” and “Validation URL”, change http to https if needed.
■ Edit Body according to your brand
■ Click [Save]
- Remember the value of Client ID field. It is a database.uuid of SaaS Server.
Configure Main Database: * open Settings/SaaS Portal SettingsSet Base SaaS domain, e.g. portal.system.hurryupandbuynow.com click Apply (do it even if you didn’t make changes).
Register Server Database in Main Database:
- Open SaaS/SaaS/Servers
○ Click [Create]
○ Set Database Name, e.g. server.system.hurryupandbuynow.com
○ Fix auto-generated Database UUID to actual one (see the previous section)
Example: text is written in red in color
○ Click [Save]
- Open SaaS/SaaS/Plans
○ Click [Create]
○ Set Plan’s name, e.g. “POS + ECommerce”
○ Set SaaS Server○ Set Template DB: type name, e.g. t1.system.hurryupandbuynow.com, and click Create “__t1.odoo.local__”
○ Click [Save]
○ Click [Create Template DB].
○ Wait a couple of minutes while Database is being created.
○ Click [Sync server]
Prepare Template Database for the plan:
- Click [Log in to template DB] at Plan’s form
■ Click login link.
- Install modules that will be used for Plan. Example: point_of_sale, website_sale
- Make any other changes in the database if needed. Example: configure the chart of accounts.
- Open Settings/Users/Users – onwer_template. Configure Access Rights for Owner.Try to create a database from the template:
○ Open SaaS/Saas/Plans – select plan
■ Click [Create Client]
■ Set DB Name, Example: client-x.system.hurryupandbuynow.com
■ Click [Create]
■ Wait a couple of minutes while Database is being created.
■ Click [Sync server]○ Open SaaS/SaaS/Client – choose client
■ Click [Configure]
● Open the Parameters tab
● Add parameter “Max Users”, set Value 2
● Click [Execute]
● Click [Close]
● Click [Log in]
● You can view the created database
● Try to create a new user to test the “Max Users” setting.
Flow with Screenshot:
- First, create the main database and server database. For database creation, you need to follow the instruction like create a database name as below in the example.Ex. .
Here you have created two databases one for main and another for a server.
- Now you will have to configure on the server database.
Goto User & Companies>Oauth providers >SaaS
Initially, you will not have a Client ID.
Goto Technical >Parameters >System Parameter.
From System Parameter copy database.uuid and paste it on the Client ID.
You have finished here configuration of the server database.
- Now you have to set the configuration in the main database side.
Goto General settings > SaaS portal
- Create the server in the main database side so you can view the configuration.
After creating the server record, you need to click on the sync server button to check whether all configuration is set or not. If all the configuration is set then the error will not pop up on the screen. From the image below, you can open the server as well.
Create a plan for your package selection in a product.
Example: Sales, CRM, Purchase etc.
1. Write the name of the plan. Select the server which you have created previously.
2. As you can view the template label. Create a template.
Goto General setting> SaaS portal.
Non-trial instances: To set access whomsoever will but it can use.
3. The configuration setting and apps you will install will be accessed by those users who will purchase this plan. Also, you can set the maximum user.
Example: Suppose you have to assign the number of the maximum user to 4 whomsoever will purchase the plan they will have maximum user 4 not more than that.
Form View of Plan:
Template Creation Form View:
After template creation, you will get the following button:
- Click on sync server to check all set or not.
- Log into template DB. By logging in from here, you can open the template DB and you can do the required setting which you want to provide to a user while accessing this plan.
- As you click on the log into template DB the following link will appear:
After login in template DB. Here you will find two users:
ii) Owner template
Owner template is for those who will purchase this plan to configure the settings accordingly and install apps which you want to set for this plan.
- Here we have given the sales and manager access. You can give access according to your requirements.
- Now you can create the product so that the user can go on the main website with their login and purchase the apps.
1. You can create the product here we have created the crm+sales product that means whenever the user will purchase this product they will get CRM and sales Apps.
2. Added the subscription period and with their users.
3. You can change the product variants price.
Example: Quarterly, Monthly, Users basis.
You need to choose the plan for this product.
Here we have selected the Crm+sales Plan.
Suppose I am a user. I will go on the Main website. On the website, I will log in using a username and password. If not registered, register and login as a new user.
I have registered here as a new user now I got my portal here, from there I can purchase the apps that I want for my business. Here I am purchasing the crm+sales Package for monthly usage to a maximum of 4 users.
After filling all the required details and payment the following page will appear which indicates that I have purchased the app and receive the order number.
Now login the main database and check the order details. You can see that here we have got the order which is purchased by the user. Now we will confirm the order and will generate the invoice. Here I am assuming I have got the payment from the user.
After doing registration and payment in Odoo the invoice is generated and mail will go to the user email. The email contains the DB creation link by clicking on the link the user can create the database.
Here the use created the DB so after logging with their username and password they can access the backend also with installed apps here according to plan we have sales and CRM.
Goto Invoice > contract
You need to create the contract so customer and here you can provide all relevant info like start date, end date, customer name their purchased plan product name and also you can define when the next invoice should create.
So after every month, the invoice gets created automatically.
Note: In documentation we have used the database as follow:
1)main database (portal.planet-odoo.in)Install Apps Saas portal, saas client,saas portal sale,restrict_access_to_client(access rights)
2)server database(server.planet-odoo.in)Install AppsSaaS server