It's been more than a year since the release of the odoo.sh took place. The odoo.sh got introduced to the market as there were no option to use the custom modules in the Odoo online.
The Odoo team is constantly adding new features to it, and recently Odoo has added an option of an online editor to the Odoo.sh. So in this session, let us discuss how the Odoo.sh online editor works.
As the name Online Editor, it allows the user to edit the source code of the Odoo from web browser itself. Simple and cool.
For the purpose of explaining the things, I have created a new repo and build in the Odoo.sh, you can see it from the below image,
So now we can look at how to access the online editor, for that click on the branches menu seen in the main menu bar.
Once you click on the branches menu, you can see the Editor, once you click on the Editor button shown in the above image, a new tab will be opened in the browser. Also, you can access the editor, from adding /odoo-sh/editor to your build domain name (e.g. https://odoo-addons-dev.odoo.com/odoo-sh/editor).
So now we are in the online editor, now we will see a tab with an environment like pycharm were we used to code.
To access the odoo source code, we have to navigate to src/odoo/addons, then we will get the odoo addons under this folder
Enterprise add-ons are placed in the src/enterprise
So let us see the working of the online editor, I have already installed sales module in my database. So we can look to make some changes in the sales module, So in the online editor, I just opened the sale.py file inside the sales module,
So we will start with a sample example, let us change the new displayed in the sales form to some other using the editor,
In the editor, I have changed the default value given to ‘New Quotation’ from ‘New’.
As we have changed the python code, the system will automatically restart the service. Now let us reload the Odoo user interface and see whether the changes get reflected there.
Once reloaded, you can see the change in the view, the New has changed to New Quotation.
Also you can see different options are there in the settings, right now the settings is set to the AutoSave documents.
If Autosave Documents is not enabled, we have to manually save it from File -> Save Python File.
Once you save a Python file which is under addons path, Odoo will detect it and reload so that your changes are reflected immediately, without having to restart the server/service manually.
But when you change the things which are stored inside the database, you have to upgrade those modules to reflect the changes the made. Either you can update/upgrade from the Odoo user interface or you can do it from the editor itself.
Also we can see the server logs from the Odoo -> Server Logs
There is a lot of other features like we can commit the changes to the Github repo from the editor terminal.