Git Product home page Git Product logo

odoo-development-training's Introduction

ODOO DEVELOPMENT TRAINING

PREREQUISITES TOOLS

On your local machine, you need to have

  • Docker v20+
  • Git (latest)
  • Visual Studio Code IDE or any other IDE of your choice
  • Terminal

CREATE A WORKING DIRECTORY

With your terminal, go to your documents directory

  • cd ~/Documents

Create the working directory with the following command

  • mkdir -p Training/Odoo

SETUP & LAUNCH DOCKER DEPLOYMENT ENVIRONMENT

Inside your working directory (~/Documents/Training/Odoo) and using your terminal,

  • Clone the branch v16 of the remote training repo git clone --branch v16 https://github.com/nsejim/odoo-development-training.git docker_deployment
  • Change directory into directory docker_deployment cd docker_deployment
  • Rename ".env.example" to ".env" with the command mv .env.example .env
  • Launch a containerised odoo server docker-compose up -d

Now your Odoo instance should be running at the url http://localhost:10016. The default master password is "odoo123".

Additional interesting commands

  • To stop the odoo server docker-compose down
  • To restart a running server docker-compose restart
  • To list running containers docker-compose ps

CONFIGURE GIT IN THE CUSTOM MODULES DIRECTORY

With the above command launching the Odoo server, a new directory (~/Documents/Training/Odoo/custom-addons) has been automatically created. This is where the code of our different custom addons modules will be saved. For better collaborative development experience, it is advised to git version the code.

  • open a new terminal
  • go the new custom addons directory cd ~/Documents/Training/Odoo/custom-addons
  • initialize a git repo git init
  • since we are developing a module for Odoo v16, create a branch v16 git checkout -b v16

Now, you are ready for coding your first Odoo custom module

SCAFFOLD A CUSTOM MODULE

Inside the docker_deployment directory ~/Documents/Training/Odoo/docker_deployment,

  • enter into the odoo container using the following command docker exec -it docker_deployment-odoo-1 /bin/bash

Inside the container, you can first validate that you have access to the Odoo CLI

  • check Odoo version odoo --version
  • show help odoo --help

Now, to scaffold a new custom module, you can use the Odoo CLI command scaffold. You can check how to use it using odoo scaffold --help

  • create a custom module called "sic_training" and save it into the container "custom-addons" directory -> odoo scaffold sic_training /mnt/custom-addons

Now if you go into your local custom-addons directory (~/Documents/Training/Odoo/custom-addons), you should see the new Odoo module source code. You can now "commit" with a message like "scaffolded a new Odoo module".

INSTALL CUSTOM MODULE

  • restart the odoo server (docker-compose restart)
  • login in the odoo backend as admin
  • Go to apps and "Update App List"
  • Search the new module in the apps list.
  • Click on "Install"

DEBUG CUSTOM MODULE

A debug configuration called "Odoo Custom Addons" is included to launch a debugging setup. Once it is running, one can place breakpoint in the python code of the custom module.

odoo-development-training's People

Contributors

nsejim avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.