Odoo ERP doesn’t need much intro. The open-source ERP is known for its immense possibilities and extensivity in covering each business function. Both Odoo Enterprise and Community Edition come in its own plethora of functions meeting the diverse needs of businesses.
The constant improvisation taking place in the application is what makes odoo separate from other market players. The large community of odoo developers constantly pitch new innovations and improvisations in the application, making it more robust and scalar. The sea of plugins simply meets the intricate needs of the business, no matter which industry they belong to. With the latest version, Odoo 13, the open-source ERP has once again proved its versatility and adaptability in meeting heterogeneous business requirements.
This blog makes an idea of how you can update your odoo code from Github. For that, you can use simple commands in the terminal to update your local odoo installation. This blog also meanwhile explains to you how to update your database for using the new updated code of odoo.
So let's see how it is done using our terminal:
1. Navigate to the correct folder
In order to update your odoo code from GitHub using the terminal, first of all, you have to navigate to the correct folder in the terminal.
So if you are at the correct folder while using the list command (ls) in the terminal, as shown above, it will list out the folders as above. It implies that you are navigated to the correct folder.
After navigating to the correct folder you have to fetch the content from Github.
2. Fetching the content from Github
Use the following command to fetch the content from Github
sudo git fetch origin 12.0
And if you are using any other versions of odoo you have to use that particular version in the above code.
That is in case of odoo version11 you have to use the command as follows:
sudo git fetch origin 11.0
3. Apply all Changes
So now you have fetched everything and you need to apply all the changes.
And the system knows what the changes need to be made and for which files. You can do this by using the git reset code as below.
sudo git reset --hard origin/12.0
The code git reset --hard will make all the changes.
Suppose you have added any custom code in your already existing modules you should not use this. That is you should not use this in any of the custom modules that you have created.
After using this command to apply the changes you can see a result similar to this as shown below:
So now while opening the Github you can see the latest change that has been made to odoo.
4. Updating the Database
Now you have to update your database so that all the changes that you have made to your odoo code will be reflected in your database. You can update your database in several ways. One of the easiest ways is to restart your odoo service using the correct parameters. Use the following command for that:
sudo service odoo9-server restart -u all -d YourDatabaseName