1.
Install Odoo
Install Odoo from git using script.
sudo wget
https://raw.githubusercontent.com/Yenthe666/InstallScript/12.0/odoo_install.sh
sudo chmod +x odoo_install.sh
sudo ./odoo_install.sh
2.Configure Odoo Installation
set dbfilter in config file (/etc/odoo.conf)
dbfilter = ^%h$
If you run odoo locally, add domains you are going to use to /etc/hosts. E.g.
127.0.0.1 odoo.local # portal
127.0.0.1 s1.odoo.local # server
127.0.0.1 t1.odoo.local # template
127.0.0.1 t2.odoo.local # template
127.0.0.1 client-x.odoo.local
127.0.0.1 client-y.odoo.local
127.0.0.1 client-z.odoo.local
Install nginx
sudo apt-get install nginx
Set reverse proxy on nginx. Add this thing to below file into cd
/etc/nginx/sites-enabled
server {
server_name example.com *.example.com ;
listen 80;
access_log /var/log/nginx/testing-access.log;
error_log /var/log/nginx/testing-error.log;
location /longpolling {
proxy_connect_timeout 3600;
proxy_read_timeout 3600;
proxy_send_timeout 3600;
send_timeout 3600;
proxy_pass http://127.0.0.1:8072;
}
location / {
proxy_connect_timeout 3600;
proxy_read_timeout 3600;
proxy_send_timeout 3600;
send_timeout 3600;
proxy_pass http://127.0.0.1:8069/;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
gzip on;
gzip_min_length 1000;
}
upstream odoo {
server 127.0.0.1:8069 weight=1 fail_timeout=0;
}
upstream odoo-im {
server 127.0.0.1:8072 weight=1 fail_timeout=0;
}
install dependencies:
oauthlib:
pip install oauthlib
requests
pip install requests --upgrade
3.Create two databases (via /web/database/manager):
Main Database, e.g example.com : * install saas_portal and saas_portal_* (optional)
modules
Server Database, e.g.s1.example.com * install saas_server
4.Configure Server Database * Activate the developer mode via
"(?)/About" menu at the top right-hand corner * Open
Settings/Users/OAuth Providers – SaaS
update domain name at "Authentication URL"
and "Validation URL", change http to https if
needed. E.g.
http://Your Domain/oauth2/auth
http://Your Domain/oauth2/tokeninfo
Edit Body according to your brand
click [Save]
remember value of Client ID field. It's a
database.uuid of SaaS Server.
5.Configure Main Database: * open Settings/SaaS Portal Setting
Set “Base SaaS domain” to your “Domain Name”
click Apply (do it even if you didn't make changes)
6.Register Server Database in Main Database
open SaaS/SaaS/Servers
click [Create]
set Database Name, e.g. s1.example.com
fix autogenerated Database UUID to actual one (see previous section)
click [Save]
7.Create Plan
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.example.com, and click Create
"__t1.example.com__"
click [Save]
click [Create Template DB].
wait couple minutes while Database is being created.
click [Sync server]
8.Prepare Template Database for Plan
click [Log in to template DB] at Plan's form
click log in link
install modules that will be used for Plan, e.g.point_of_sale,website_sale
make any other changes in database if needed. E.g. configure chart of accounts.
open Settings/Users/Users - onwer_template. Configure Access Rights for Owner.
9.Try to create database from template
open SaaS/Saas/Plans - select plan
click [Create Client]
set DB Name, e.g. client-x.example.com
click [Create]
wait couple minutes while Database is being created.
click [Sync server]
open SaaS/SaaS/Client - choose client
click [Configure]
open Parameters tab
add parameter "Max Users", set Value 2
click [Execute]
click [Close]
click [Log in]
you see created database
try to create new user to test "Max Users" setting
Structure of SaaS system
SaaS Portal - main database for control servers and clients, manage
client templates and plans.
SaaS Servers - technical databases to control client databases. SaaS
server create, edit, delete databases. Each SaaS Server can be
installed on a separate machine (e.g. VPS)
SaaS Clients - client database to be used by customers. Each SaaS
Client is attached to a SaaS Server.
Main Database
* After the above configuration main database (saas portal) can be accessed through www.your-
domain.com
login as administrator
here we can control servers and clients and also manage client templates and plans
1.Create a product and select a plan in ‘Related SaaS plan’ field.
Publish it on website using ‘Unpublished on website’ button.
2.Click on ‘Unpublished’ to publish it on website
For a customer, signup go to ‘www.your-domain.com’
1. If a customer doesn’t have an account, using ‘Don’t have an account’ customer can signup.
2. Enter your Email, Name, and Password. Customer can signup.
3.Now click on the ‘Shop’ button
4. Select the product(plan).
5. Click on ‘Add to cart’ and keep qty as 1.
6. Click on ‘Process checkout’.
7. Add address an go to ‘Next’.
8. Confirm the order.
9. Pay the invoice using the ‘Pay Now’ button.
Under Main DB ‘your-domain.com’
1. Confirm the client’s quotation and create the invoice.
2.‘Validate’ the invoice and then Click on ‘Register payment’.
After ‘Register payment’ completion the customer will get the email
3.create and configure client DB
1.open SaaS/Saas/Plans - select plan
2.click [Create Client]
3.set DB Name, e.g. client-x.example.com
4.Assign customer
5.click [Create]
6.wait couple minutes while Database is being created.
7.click [Login]
8. click on the link ‘it will redirect you to client db’
9. Go to settings/users/ and select the user
10. Give access rights for the customer
11. Click on ‘send invitation’
For Customer
1. Check your email and Signup with the login and go to the link
2.It will redirect you to the ‘Client DB .