Setting up multi-website with multiple (sub)domains in Odoo

In this tutorial I will learn you how to setup multiple website in Odoo and linking them to multiple (sub)domains. This allows you to setup multiple websites – and webshops – from one shared Odoo database and having those websites run on multiple (sub)domains.
In this tutorial I will setup two websites that link to two subdomains. Let’s assume that you want to have two separate websites where one is an informaton center and one is a shop.
We’ll host the information center on information.yourwebsite.com and the shop on shop.yourinformation.com.

1. Creating multiple websites

The first step in adding an extra website (after the initial one) is by going to Website > Configuration > Settings and clicking on the button “Create a new website”. After clicking on this button you will get a pop-up:

Website configuration pop-up when opened

The website name is just informative and will be shown throughout Odoo so give it a good name, such as “Information portal” in our case. The second field, “Website Domain” will tell Odoo to which (sub)domain all pages related to this website should link. Enter the website URL here without www or https:// in front of it and no slashes, so like this:

Website configuration pop-up after configuration

When this is done click on “Pick a theme”, choose one, save and your second website is set up.
The next step is that you most likely want to configure extra options for your website such as the languages, social media accounts and so on. You can do this from Website > Configuration > Settings again. Keep a close eye out though! The options configured here are website specific! Be sure to first select the website you want to configure at the top before configuring your website further:

Website switcher in website configuration

Repeat this step for as many websites as you like. Once you’re done it is time for the next step, setting up the DBS records.

2. Setting up the DNS

Now that you’ve setup your website(s) in Odoo it is time to configure the DNS. By configuring the DNS you will tell Odoo that when the user enters a website URL in the web browser (for example www.information.yourwebsite.com) to which server it should connect to get the data from.
Luckily this step is pretty forward. Login to the portal where your DNS is managed – usually your hosting provider – and add an A-record to your DNS list which connects the URL to the IP of the server. Your configuration will look something like this:

Sample DNS A-record

3. Configuring NGINX

Alright, so now we’ve told Odoo that we want a website and where it points too and we told our DNS which URL should go to which server (IP). The final step is to tell Nginx (or whichever alternative you use) which domain should link to where. You should already have an Nginx configuration file with a server block. The easiest is to make a duplicate of this block in the existing configuration file. Make sure that this duplicated code block it’s “server_name” points to the domain you’ve setup in the frontend of Odoo (so “information.yourwebsite.com”). Typically it would look something like this:


That’s it! Just don’t forget to reload and restart your Nginx to apply these changes (sudo service nginx reload and service nginx restart). If you do this configuration you can setup multiple websites with a separate design (theme) running on separate (sub)domains!

4. Conclusion

Thanks to the default built-in features from Odoo setting up multiple websites, webshops or portals is pretty easy! By just creating a second website, adding a DNS records and an Nginx server block you can have a new website running in a matter of minutes!
Has this tutorial helped you, do you have any feedback or questions? Post away!

The Odoo Store banner

Introducing The Odoo Store: Find everything you’re looking for to integrate with your Odoo

Hey! It’s been a while, again. The last time you heard from me was when I presented you our Odoo training platform Oocademy. In the meanwhile, Oocademy has reached 3.500 members! How cool is that?! 
We’re very happy to see that we’re able to help out the Odoo community, which is why I’m here to introduce you to a new platform!
We believe we can contribute to the community even more than we do now. This is why we built The Odoo Store: one place with everything you need for your Odoo. 🚀

The Odoo Store

The Odoo Store: an online platform to find everything for your Odoo! 🔎

Like Oocademy, The Odoo Store revolves about connecting, sharing and improving the Odoo ecosystem. We wanted to create a very extended and complete website, where every Odoo user can easily find what they’re looking for to integrate with their Odoo. The Odoo Store is a place where you can browse through different apps, themes, e-documents and partners and where we really value quality. Use the advanced search options to quickly get the results you’re after. It’s that easy! 

Why did we build it? 🛠️

I honestly felt that the current Odoo appstore just didn’t cut it. I got frustrated over quite some things such as the quality of the apps on the platform, having barely any options to find content and that there where never any new features or improvements coming. There’s basically nothing to motivate people to do better and to improve the platform.
Once I heard that many people feel the same way I decided it was time to do better and take it to the next level. I only have one major goal with this platform: to empower Odoo developers and help Odoo users get more out of the available content.

What does The Odoo Store have to offer? 💎

Our platform consists out of four major pillars:

Apps: 
Browse through our extended collection of apps. Use different filters to narrow down your search, sort by your preferences and check out the app reviews! You’re also able to see if apps are certified and secure before buying and installing them. 
 
Themes: 
With a large number of themes available, you’ll find the perfect one for your website. Start creating the website you’ve been dreaming of in just a matter of seconds! 
 
E-docs: 
Odoo is a very extended and versatile ERP-system. It’s not uncommon to get overwhelmed by all the options and possibilities it contains.  
With the online documentation, you’ll be able to learn a lot about Odoo in general, or about a specific feature or problem you’re facing. 
 
Partners: 
The Odoo Store is here for everyone connected to Odoo. As a partner, you’ll be able to create your own profile introducing your services, apps, themes and many more. This way, people in need of some help with their Odoo can easily find a partner to collaborate with! 


The Odoo Store: where quality is key 👌

We wouldn’t have created The Odoo Store if we didn’t believe it has many benefits you can enjoy.  
First of all, as we said before, we’ve combined everything for your Odoo into one website. Besides that, we’ve created advanced search and filter options which make your search way easier.  
No more browsing through all pages, wasting valuable time and not getting the results you’re hoping for. At The Odoo Store you can quickly find what you’re looking for.  
 
We highly value good quality work and that’s the reason why we took an extra step: every app that’s being uploaded for sale is extensively checked on it’s quality and security level. We provide feedback for code and security improvements for the seller and make sure that the buyers get the best quality there is. And because we really love the Odoo community, this is all for free! 
 
Do you really want to stand out with your app and get some extra support? 
For a small fee, sellers can get a code review and earn a certification for their app. Buyers can see whether an app is certified, or not, and so this will increase your credibility and sales! 
 
If that isn’t enough, we also provide highlighted areas on our website. You can pick a date and period for any app, theme etc. you want to draw some extra attention to as a vendor. Get your business out there in the spotlights!
 

Vendor’s commissions 💶

Also very important to know: what will you earn as a vendor?  
As every other online selling platform, we take a little bit of the revenue for maintaining the website, providing services, etc. But we want you, as a vendor, to get rewarded for your hard work. That’s why we pay you a 75% commission. 
And, above that, you never have to wait long before we pay out. We set our threshold at €200, because nobody likes to wait for their well-earned money! 

Stay in control with our AppManager 💪

The Odoo Store | AppManager
Logo AppManager

We’re probably not the only one, but we like to stay in control of our apps. That’s why we had the need to create an app to help us with that. That’s how the AppManager came to life! 
The AppManager provides you a clever overview of all your installed apps. This overview helps you to compare the newest version with the installed version, so you can easily check if your apps are up-to-date. Is there an update available for one of your apps? You’ll automatically get a notification. Just click the update button and you’re ready to go!
 

Why would you use The Odoo Store? 🤔

A question that some of you will probably already have is “Why The Odoo Store” and not the official app store?”
The aim of our platform is to improve the ecosystem for everyone. Both the seller and the purchases (or user if it is free) should get the best possible.


A great content builder should stand out and the platform has to help them. We do so by pushing quality content to the top while pushing bad quality content down. Besides of this the sellers on our platform get more commission. This empowers them to do even better as we take less of the profit. We only take 25% commission on the sales and offer an extra range of tools to help the developers improve.

Besides of these benefits we will be using the revenue that we make to actively improve/expand our platform and to boost the Odoo ecosystem. We’re not here to make a ‘quick buck’. We’re here to change the ecosystem and to push it to the next level!
When you sell or buy on our platform it means you are part of being the change to improve the Odoo world even more.🏆
 

What’s next? 🔥

As you probably already guessed this is just the start of our platform. There’s so much potential with these kind of platforms, we can do even better!
Sadly – as we’ve noticed before in the past – there are quite some companies lurking around to run off with some ideas so I won’t go into details here but to give you a rough idea:

  • More insights/analysis about apps,
  • Empowering the Odoo developers,
  • Pushing forward for the quality of apps,
  • A connector with another platform,
  • Something 🎯 (it is still a wild dream in my head, hah!)

Finally, we would love your feedback and ideas. If you have ideas, comments or anything feel free to comment here or reach out to me personally. I’d like to have an as open communication and collaboration with others as I can so shoot!

Go check it out! 🚀

We can make this blog even longer and tell you even more about our new platform. But our advice? If you’re an Odoo user, go check it out yourselves! 😊

Introducing Oocademy: better Odoo e-learning for you

As you’ve probably already noticed it has been quite a while that I’ve published a new tutorial here. Ever since I’ve started writing tutorials here I had one goal. Share as much knowledge as possible in an easy to access way that everybody understands. No matter their knowledge. After a few years on this blog I noticed that this blog wasn’t cutting it anymore though. I started missing some features that became harder to ignore as time went by.

Why I started building an e-learning platform

Oocademy: Odoo e-learning wallpaper

Because of this I’ve decided to build an e-learning platform on my own: Oocademy. Oocademy is the tool that I’ve always wished that existed to help others and enables the missing features that I missed:

  • Manage versioned tutorials/documentation as code usually changes on another Odoo version.
  • Quick linking & smarter logic to find related content.
  • Advanced search options for users so they can find content fast(er).
  • The ability to write documentation and apps along with the tutorials.
  • The ability to create exams and certificates so that developers can test their Odoo knowledge
  • Keeping wishlists of all the content and keeping track of the progress of reading content.
  • Many other, smaller, things.

Five years after I started writing tutorials on this blog I still have the same opinion about the Odoo world. There is far too little good content for developers to learn from. The official Odoo documentation only highlights some major functionalities, it is pretty outdated and contains very little examples. In the meanwhile some content has showed up but the speed in which content is being added is still too slow, not to mention the quality of it.

This is where Oocademy comes in. It is built to help you find the content that you need. A few months ago I’ve started writing tutorials, documentation and apps specifically for Odoo 13 and here I am today to announce the launch. At this point I’ve published 43 tutorials, 19 documentation pages, 37 apps and two exams and most of the content is specifically written for V13!

Accessing Oocademy

So, how does it work? On Oocademy every tutorial, documentation page, app or exam is either free, behind a login or premium content: Oocademy: preview of tutorials overview


If the content is free you can read all of it without needing any membership or login. When it is freemium you can access it for free and you just need to register (which takes just 10 seconds and can be done from the Oocademy homepage). If it is premium content you’ll need to buy membership. To celebrate the launch of Odoo 13 and all the content for V13 on Oocademy I’m giving huge discounts though. The first 100 new users can buy premium membership starting from €10 a month.

Now I bet you’re wondering why isn’t all of the content free? Of course I wanted to keep it all free but creating a whole e-learning platform and writing all this content takes a lot of time. Just to give you an idea: I’ve invested +- 600 hours in this project (75 working days!) to get to this point. The fact is that any bigger platform needs to have a paid tier to make it grow and to be able to maintain it well. If I just get 200 premium users a month I can put at least two extra days of work into Oocademy, every single week.

If you don’t want – or can’t – pay you can register for free too though! Just fill in your email, name and password and you can start reading content within seconds.

What is the roadmap?

And this brings us to the roadmap ofcourse. I still have a whole lot planned for Oocademy in the future. The most important part is more content. The goal is to create tutorials, apps and documentation for every functionality in Odoo. Besides of the content I want to add quite some extra features:

  • Code generators to create dynamic pieces of code for the main Odoo functionalities. Examples are QWeb reports, domain builders, menuitems, …
  • Webinars / tutorials written by specialists in that specific domain. For example a tutorial about workers written by Olivier Odony.
  • Training courses: a chapter-like tutorial which explains a bigger functionality part by part. For example how to create webpages with controllers and custom search filters.
  • A secret project that will stay a secret for now. 😉
  • Do you have any ideas or suggestions? Please post them in the comments! 🙂

Conclusion

I really hope to see you on Oocademy and most importantly that it helps you grow! All the tutorials that are written here will stay available and for free, forever. Gradually I’ll also update all these tutorials on Oocademy so that they’re up to date and working for a specific version.

Oh and as Odoo V13 is being released.. check out our newest tutorial about how to install Odoo 13!

Let us work on an Odoo community that has better content for both new and experienced developers. Our community deserves this.

Regards,
Yenthe Van Ginneken
CEO & Founder of Oocademy

Odoo 12 homepage screen

Installing Odoo 12 (enterprise) on Ubuntu

In this tutorial I will learn you how to install Odoo 12 community or enterprise on Ubuntu 18.04. The script that you will use is based on the code from André Schenkels but has been updated, upgraded and improved. Do notice that if you want to install the enterprise version that you will need to be an official partner or that you need to have bought the enterprise subscription from Odoo. Otherwise you will have no access to the Github repository for the enterprise code!

1. Downloading the script

The first step is to download my script from Github and to add the code in a new .sh file on your Ubuntu machine, wherever you’d like this.
For example right under /home. Open up an Ubuntu terminal and cd to the directory where you’d like to keep the script and then create the file:

If you’re curious about how the whole code looks and works you can find it on my Github account.
Now open up the file and edit the parameters to your liking:

There are some things you can configure/change to your likings at the top of the script. You can choose if you wish to install Wkhtmltopdf or not, which version you’d like, where the location is and most importantly what the master admin password is.
Tip: always modify this for every Odoo you install!
If you want the enterprise version of V12 you should change the line IS_ENTERPRISE to true:

If you want the community version you can just continue and keep the IS_ENTERPRISE key on “False” (which is the case by default):

2. Making the Odoo installation file executable

The next step is to make this file executable. After you’ve made it executable you can execute it and everything will be installed automatically.
do this with the following command:

3.Running the script

Now that the code is in your file and the file is executable you simply have to execute it with the following command:

You will see that the script automatically starts updates, downloads required packages, creates the user, downloads the code from Github, … Eventually, if you’ve chosen to install the enterprise version, you will need to give in your Github credentials to download the enterprise code (since this is a private repository). Fill in your details and let the script continue:
Odoo 12 enterprise authentication
Give the script a few minutes to configure and install everything and eventually you will see something like this:
Result install script Odoo 12

You now have a fully functional Odoo V12 community or enterprise on your system! Congratulations.
Odoo V12

4. Extra information about Odoo 12 Enterprise

Since Odoo Enterprise uses code from both http://github.com/odoo/odoo and http://github.com/odoo/enterprise we will separate the code with this script. This will make future upgrades easier and the code is nicely separated. This means that the default V12 code will be under /odoo/odoo-server/ and all the enterprise code will be under /odoo/enterprise/.

In the script you saw there was an option to change the Odoo port (OE_PORT). When you’d change this port number to 8070 in the install script it would be applied to /etc/your-config-file.conf and this would give you the ability to change the default port.
To apply these changes you should do the following:
Changing Odoo settings
The -c will change the configuration and memorize what you’ve changed under /etc/your-config-file.conf. Because my port was set to 8070 this is telling the Odoo that it should run on port 8070. When you would now open up your browser and navigate to http://localhost:8070/ you will see it is running there:
Odoo V12 alternative port

Has this tutorial helped you, do you have any feedback or questions? Post away!
Tutorial sponsored by Oocademy




PayPal
New building block result

Creating building blocks in Odoo

In this tutorial I will learn you how to create new building blocks and how to add the blocks to the menu so that you can quickly drag and drop the blocks in the webpage.
In this tutorial I will create a new building block named “References with title” which will show four icons and a title above it:
New building block result

1. Adding the dependency

Before you can start creating a new building block you will need to create a new module and configure the manifest.py correctly. Open up your manifest.py and add the website as a dependency:

Without this dependency you cannot create and add new building blocks to the Odoo website.

2. Creating a new XML file

Now create a new XML file named “snippets.xml” under the “views” folder:
snippets.xml structure
In this file we will add all the code to create the building block (snippet) and to make it visible in the editor.

2.1 Creating the building blocks

First we will need to create the building block itself. Let us create a building block that has a title (h3) saying “Our references” with four logo’s under the title. Have a look at this code:

So, what does this tell us? We first create a new XML record. After doing this we add all our code within a section block and inside this we create a container div. Within this section and container you can basically code anything you like, this is the framework for any building block. Generally when you create a building block you try to use as much bootstrap classes as possible. In the above example I simply made two rows. One row for the title and one row for the images. Those images are all the same width thanks to the default bootstrap classes col-md, col-sm and col-xs-6.
You’re already well over halfway to your own building block! If you would install this module right now all the code would be there that is needed for a building block, but we still have to show it in the editor so that we can use it.

2.2 Adding the building block to the editor

Let us continue and add a building block preview to the editor so you can quickly find it from the editor.
You can do this by inheriting the default “website.snippets” record and doing an xpath in the “snippet_structure” id, which holds the main structure of the editor. Have a look at this code:

Let me explain the code a bit further. We first inherit the default ‘website.snippets’ record, which holds the link to all available snippets. By doing an xpath on ‘snippet_structure’ we’re telling Odoo to add our building block preview within the editor. In this xpath element we add a div and we use the t-snippet element made by Odoo. By doing so Odoo knows we want to add a snippet preview to the editor.
Finally save this file and add it in the manifest.py file so that it is loaded:

When you now install the module you will see your new building block is available for use from the editor:
Building block editor example
That is all. You’ve just made your own building block, congratulations!

3. Conclusion

Thanks to the Odoo framework it is very easy to create and use new building blocks. The functionality is so flexible and easy to use that you can create a building block for about anything. Creating and reusing building blocks in Odoo is one of the biggest strengths of the Odoo website editor.

Do you want to try the demo code and see the source code of this tutorial? You can view it on my Github account.
Has this tutorial helped you, do you have any feedback or questions? Post away!
Tutorial sponsored by Oocademy


PayPal
Public repository result

Configuring submodules on Odoo.sh

In this tutorial I will learn you how to create and use submodules in Odoo.sh. In this example I will create a public submodule and a private submodule and I will link them to the Odoo.sh project.

1. Introduction to submodules

Tip: If you haven’t made an Odoo.sh project yet you can follow my tutorial here.
So, what exactly is a submodule? A submodule is a link from one Github repository to another repository. You can see it as a virtual pointer to a specific commit in time of the remote repository.

For Odoo.sh there are two major differences. You have public submodules and private submodules. Public repositories are those that are publicly available (for example https://github.com/odoo/odoo). Private repositories are the repositories that are not publicly available. Usually you have private repositories when you work for a company and when you manage customer code.
There is a big difference in using public or private submodules on Odoo.sh though. When you have a public repository you can easily add the submodule and it will work. For a private repository you will need to generate a deploy key on Odoo.sh and then add it on the remote Github repository.

1.1 Why use submodules?

Now we know what a submodule is but the question is why would you use a submodule? Submodules are very handy to use if you want to include third party apps in your Odoo.sh tests. The only other way to get this code available in your Odoo.sh builds is to add all this third party code in your own repository. But what if the third party developer has made a lot of changes, fixes or improvements? If you don’t use submodules you will constantly need to download the remote apps, add them to your own repository and keep track of all those changes. This is the true power of submodules. Now let us first link a public repository to the Odoo.sh project in chapter 2. In chapter 3 I will learn you how to add a private repository as a submodule.

2. Public repositories

Setting up public repositories is really very easy to do.
You will need to create a submodule and commit it to Github. Go to your Github repository, switch to the correct branch and add the submodule from the command line:

This new commit will trigger a new Odoo.sh build. After this build is ready you will see that the modules from the OCA/hr repository are available on this instance:
Public repository result
Great job! This is all you need for a public repository. If you also have a private repository and want to add it then continue to the next chapter.

3. Private repositories

Alright now let us configure the use of a private submodule! Go back to your Odoo.sh project to the settings tab and add the link to your private repository (git@github.com:youruser/repository.git). In your repository you could now make a commit to add the repository as a submodule. For a private repository however you have some extra work. You have to copy the generated key from the Odoo.sh project and add it on Github. First copy the key:
Private key configuration submodules
Now go to the repository where you’ve linked to (so the submodule), go to the settings tab, open “Deploy keys” and add your own key here by clicking on “Deploy key”:
Add deploy key Github
Now add the key in the next screen and click on “Add key”:
Deploy key add screen
After doing this Odoo.sh can find the private repository and can access all the data it needs. The final thing you need to do is to add the submodule from the command line, commit it and push it to Github:

This new commit will trigger a new Odoo.sh build. After this build is ready you will see that the modules from your other private repository are available on this instance.

4. Conclusion

Using submodules in combination with Odoo.sh is very powerfull and handy to use. Setting it up in the beginning might take some time and you can make some mistakes but in the long run it will save you a load of time and redundant code. As a result it’ll improve your testing a lot as all your custom code will be automatically tested.
If you can use submodules and want to test your deployments on Odoo.sh then submodules are the way to go.
Has this tutorial helped you, do you have any feedback or questions? Post away!
Tutorial sponsored by Oocademy


PayPal