Starting Your First Task: SH - odoo-ps/pshk-process GitHub Wiki

Starting Your First Task: SH

The big difference between Saas and SH is the ability to override functions for any model using python. Which means that, you have more flexibility in overriding some functionalities.

Whatever you can do on Saas, you should be able to do it in SH as well but not vice versa.

1. Repository

For SH project, the repository is specialized for each client. If you haven't been added to the SH project, don't forget to add yourself.

Example: sh_1

sh_2

sh_3

sh_4

sh_5

Once you've added it, you should be able to see it on your odoo.sh account.

When you see the SH project page, you will see the branches on the left sidebar of your page.

sh_6

2. Cloning

For SH projects, it is recommended that you store them all in one directory as well. This upper level directory should be on the same level as pshk-custom.

Click on the production branch to do clone.

sh_7

It's possible that the repo is hosted on client's side in which case, you will also need to ask the FC to ask the client to add your github account to the github repository access.

3. Branching

ALWAYS branch out from the production branch. This is to ensure that when you push to production branch (which will happen by the end of task) , no conflicts will arise (extra commit from staging branch etc.).

When you create your dev branch, it is in the format of {version}-{task_id}-{trigram}.
I.e.

git checkout main
git checkout -b 14.0-2634612-nni

This branch will be specific to only your task.

4. DB fetching

This process should be the same as the one on Saas.

The DB to fetch is from the production branch.

cd /path/to/support-tools
./oe-support.py fetch <production db link>

5. Local Development and Testing

If you have done the technical training, you probably have come across the instance when you are asked to install your own module.

As a refresher

odoo-bin --addons-path=/path/to/community,/path/to/enterprise,/path/to/client_sh_repo -d {local_db_name} -i module_name

Tip: test your development in small changes at high frequency.

6. Testing (staging)

Once you're confident enough with your development, you want to merge the development to staging (for testing purposes first).

Similar to one in Saas, we want to keep the commit to each task/module to 1. So before you merge to staging, you want to squash your commits into one first. Follow the same procedure from Saas.

When you have squashed the commit, do a push

git push origin HEAD

sh_8

Once you've done git push, you should be able to see your branch on "Development section"

sh_9 sh_10

Do a drag and drop then click on rebase and merge.

Then it will take some time before it's properly merged. sh_11 Once it's succesfully merged, it should show test: success with connectbutton turned green.

At this point, your code is already in the repository BUT, the app itself is not installed yet.

To install it, go to your shell

sh_12

Once the console comes up, type the command:

odoo-bin -i {module_name} --stop-after-init

odoosh-restart

Let the FC know it should be ready for testing on that particular staging branch.

7. Pushing to Production

After functional testing and client validation, when code is good to merge, you can do the same thing like you did for testing (staging). Drag and drop your branch to production branch, rebase and merge, and install.