Documentation › Day to day

Tools

Web shell, SSH, the online editor, Python and Odoo shell consoles, logs, and pushing from the shell.

The tools work on the running build of a branch. Developers can use them on development branches, testers on staging too, and admins on production as well.

Web shell

Click Shell on a branch. You get a terminal inside the build's container, with tabs for more shells, a SQL console (psql on the build's database), an Odoo shell and a Python console, and a side-by-side split. On production you confirm first. Commands typed are recorded in the audit logs, and idle sessions close after a while.

~/src/user : your repository at the build's commit. ~/src/odoo : Odoo's sources.

odoo-update my_module updates a module and restarts Odoo. odoosh-restart restarts it.

~/logs/odoo.log : the server log. lnav , grep and ncdu are installed.

SSH

Add your public key on your Profile page: the keys of your GitHub account are accepted automatically. Then connect with the build number shown in the branch's History ( #1234 ):

ssh -p 2222 <build-number>@cloud.knovadigital.com

Your Profile page shows the exact command for this platform. Admins can limit SSH into production and staging to some IP addresses in Settings → SSH firewall .

The editor

Click Editor on a branch for a code editor in the browser, with file search, a diff against GitHub, and terminals ( ⌘ J ). Saved files change the running build only:

Restart Odoo after changing Python code, Update module after changing XML or data files.

Commit pushes your changes to the branch on GitHub, which starts a new build. Changes that aren't committed are lost on the next build.

Odoo's sources and the logs are shown read-only next to your repository.

Python and Odoo shell consoles

The Odoo shell opens odoo shell on the build's database with env ready. The Python console is IPython (or plain Python). Open them from the shell page's + menu or the editor's Console menu.

Odoo shell

env["res.partner"].search_count([])

env["sale.order"].browse(42).action_confirm()

env.cr.commit() # without it, the changes are rolled back when the console closes

Logs

The branch's Logs tab streams the logs of any build: build.log (the build steps), odoo.log (the server) and the logs of each phase when they exist ( pip.log , install.log , update.log …). In the shell, they're in ~/logs .

Code profiler

Something is slow? The branch's Tools tab records what every Odoo worker does for up to five minutes and shows it as a flame graph, function by function. The server is slower while it records, so keep it short and do just the one slow action meanwhile.

Pushing from the shell

~/src/user is a git checkout of your branch. Its https remote lets you push a fix made in the container. Git asks for your GitHub username and a personal access token (not your password); nothing is stored.

cd ~/src/user

git config user.name "Your Name"

git config user.email "you@yourcompany.com"

git add -A

git commit -m "[FIX] my_module: correct the invoice total"

git push https HEAD:<branch>

If someone pushed to the branch after this build, the push is refused. Pull their changes on your computer instead, or use the editor's Commit .