First Steps with ownerp.io - Visual Code based on OpenVSCode


14.01.2024

1.85.1 - Odoo 12-16 (Odoo 10 and python 2.7 nur noch mit 1.66.1)

Login

Open the URL https://vsXX.ownerp.io/?tkn=YourToken in a browser and login with your password: 

(Credentials from Admin  )

Global settings

Set some global settings
You can enhance the global settings of VS Code with these parameters.

{ "terminal.integrated.defaultProfile.linux": "zsh", "editor.renderWhitespace": "all", "extensions.autoUpdate": false, "editor.fontSize": 16, "debug.console.fontSize": 16, "terminal.integrated.sendKeybindingsToShell": true, "terminal.integrated.fontSize": 16, "git.enableSmartCommit": true, "git.autoRepositoryDetection": "subFolders", "git.autofetch": true, "git.confirmSync": false, "explorer.confirmDragAndDrop": false, "python.defaultInterpreterPath": "/opt/venv/p3/bin/python3", "editor.accessibilityPageSize": 13, "workbench.startupEditor": "none", "workbench.colorTheme": "Tomorrow Night Blue", }

Access from shell

ver=”0”
docker exec -ti dev-vs-$ver env COLUMNS=$COLUMNS LINES=$LINES TERM=$TERM /bin/zsh

Before update

 

After update use

Update .zshrc


The Visual Studio Code screen appears in Browser. 

Python Version

Use the latest Python Version in VSC.

Install Extensions: 

Necessary: Python, Jupyter, Gitlens 

 

Other Extensions & Themes can be installed optional.

IMPORTANT DEBUGGING

ONLY DEBUGGING WITHOUT WORKERS IN ODOO.CONF

Unique steps: 

Connect gitlab & github and ownerp.io

To connect the VM to Gitlab, generate the key as described in the article Cheat Sheet for VM Shell Shortcuts under Prepare git Access

Then go to Gitlab and store the key in the profile under Settings > SSH Key.



With the same key you should also connect to your Github https://github.com/ account: go to your user top right > Settings> SSH & GPG Keys
New SSH Key entry: 



A test Commit is recommended after add over terminal:


git username / email

 

Pull dev-helpers 

Repository: https://gitlab.ownerp.io/myodoo-tools/dev-helpers

Über Terminal in /home/workspace/gitbase navigieren. 

myodoo.sh branch pull

ownerp.io branch pull from 1.74.x
myodoo.sh branch pull till 1.66.x

Do the Inital scripts 

Over the terminal navigate to /gitbase/dev-helpers/scripts/gitpull 

ownerp.io branch pull

Odoo servers must be pulled separately for all versions: (https://gitlab.ownerp.io/myodoo-tools/dev-helpers/-/blob/ownerp.io-2023/scripts/gitpull/get-initial-gitlab-odoo-servers.py?ref_type=heads)

pull servers

Installations:

Installing over sudo possible. (Password in 1Password) 

More steps / usage:

How to change the Python Interpreter?

[CRTL] + [SHIFT] + P

How to add python libs to the venv?

Edit and rerun the build script for the environment:

Pull repositories/ update (was switch-to-develop before) 

Navigate to the path you need e.g. /gitbase/v13 over File > Open Folder> Path

 

Click the Run and Debug symbol and  click on Pull v13 Repositories (oder v10 oder v11 oder v12 oder v14) 

Database restore 

ZIP-files have to be in the uploads directory. 
Variant 1 in terminal:   wget - command e.g. from a Dropbox: wget https://www.dropbox.com/s/7xph0yoh3v0o2kn/v13_skr03_demo_2021-03-31.zip 

or via Sharepoint (Onedrive) e.g.

wget https://cmcequitania-my.sharepoint.com/:u:/g/personal/j_eberle_equitania_de/ETdOASWLABKoBMLJAuwy2gBYO_6dZwTpVK9IwLeKvhHRQ?download=1 -O mydb.zip (add the download=1 and the -O part with you document file in the generated link) Only OneDrive oder Dropbox possible. 

Variante 2 over Script: cloud-downloader-equitania > Hidrive/ Onedrive / Dropbox / Google Drive possible!

Install the script over pip install in your dev environment, you have to update the script of the env you want to use: 

Install download helpers or others

Navigate into uploads folder: 

cloud download

cloud-download --help shows options: 

These can be added directly into the command: 

Cloud Download use

Navigate over the terminal in /gitbase/dev-helpers/scripts/ :

cd command

Execute Restore Zip: 

Use restore script

The rest of the restore is like in guacamole VM.  

IMPORTANT: when restoring always start with version abbreviation v12_ v13_ v14_ etc.

Start database / Odoo: 

  • open Terminal 

Change Odoo environment : e.g. dev13

Enter the command for starting a DB. (exam10 / exam12 / exam13 etc. ) 

E.g.

Start Odoo from shell



URL for Odoo in Browser: devxx.myodoo.sh > internal Port 8069

A second Odoo session can be started via port 9069 > devxx-2.myodoo.sh  (with separate Odoo Config file → xmlrpc_port = 9069) 

Important directories:

In odoo-share: here is our filestorage
In upgrade: for database upgrade processes 
In rm-odoo: build over Access code customer servers 
In uploads: database Zips
In venv: Python environments  

Kill all Python processes



Kill all Python processes




Make your own Config files

Create a new folder conf e.g. under /home/workspace/conf and create your own config file there. (Right click > New file)
Accordingly the start path for the DB must be adapted to ./odoo-bin -c /home/workspace/myconfs/odoo12_xy.conf

Pull process

Over Terminal: 

pull with shell

or like written before in  section "Pull repositories"

Commit & Push process

Stage changes over the plus sign: 

Enter a commit message: 

Shortcut Control + Enter = Commit 

Push over the arrow sign: 

OR over the 3 dots > Push

Open second terminal:

To open another terminal, go to the plus sign in the terminal next to the dropdown:

Switch between the two terminals using the dropdown:



If there are more than two terminals, it is recommended to use tmux (see below). 

SQL queries over PG Admin in browser  

URL: pgxx.myodoo.sh 
+ User from 1Password. 



If a DB cannot be deleted, open sessions can be the reason then kill session in PG Admin: 

look in https://stackoverflow.com/questions/5108876/kill-a-postgresql-session-connection





Important Shell Shortcuts and tmux:  Cheat Sheet für myodoo.sh Shortcuts