The online editor allows you to edit the source code of your builds from a web browser. It also gives you the possibility to open terminals, Python consoles, Odoo Shell consoles and Notebooks.
You can access the editor of a build through the branches tabs, the builds dropdown menu or by adding /odoo-sh/editor to your build domain name (e.g. https://odoo-addons-master-1.dev.odoo.com/odoo-sh/editor).
Edit the source code
The working directory is composed of the following folders:
You can edit the source code (files under /src) in development and staging builds.
For production builds, the source code is read-only, because applying local changes on a production server is not a good practice.
The source code of your Github repository is located under /src/user,
The source code of Odoo is located under
To open a file in the editor, just double-click on it in the file browser panel on the left.
You can then begin to make your changes. You can save your changes with the menuor by hitting the Ctrl+S shortcut.
If you save a Python file which is under your Odoo server addons path, Odoo will detect it and reload automatically so your changes are reflected immediately, without having to restart the server manually.
However, if the change is a data stored in database, such as the label of a field, or a view, you have to update the according module to apply the change. You can update the module of the currently opened file by using the menu. Note that the file considered as currently opened is the file focused in the text editor, not the file highlighted in the file browser.
You can also open a terminal and execute the command:
Commit & Push your changes
You have the possibility to commit and push your changes to your Github repository.
Open a terminal (),
Change the directory to ~/src/user using
Stage your changes using
Commit your changes using
Push your changes using
git push https HEAD:<branch>.
In this last command,
https is the name of your HTTPS Github remote repository (e.g. https://github.com/username/repository.git),
HEAD is the reference to the latest revision you committed,
<branch> must be replaced by the name of the branch to which you want to push the changes, most-likely the current branch if you work in a development build.
Once your changes are pushed, according to your branch push behavior, a new build may be created. You can continue to work in the editor you pushed from, as it will have the same revision as the new build that was created, but always make sure to be in an editor of a build using the latest revision of your branch.
You can open Python consoles, which are IPython interactive shells. One of the most interesting addition to use a Python console rather than a IPython shell within a terminal is the rich display capabilities. Thanks to this, you will be able to display objects in HTML.
You can for instance display cells of a CSV file using pandas.
You can also open an Odoo Shell console to play around with the Odoo registry and model methods of your database. You can also directly read or write on your records.
You can use env to invoke models of your database registry, e.g.
Pretty gives you the possibility to easily display lists and dicts in a pretty way, using the rich display mentioned above.
You can also use pandas to display graphs.