Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

Odoo.py CLI

Naroči se

Get notified when there's activity on this post

This question has been flagged
3 Odgovori
6038 Prikazi
Avatar
Hieu Lam

HI everyone, 

I'm new to odoo. Recently, I need to automate our build process for odoo. And this is some approach that I intend to try 

1. Use cli odoo.py as background process but the problem is that everytime I run odoo.py, it create a new process ?

2. I could create a daemon thread as describe in this tutorial  https://www.linode.com/docs/websites/cms/install-odoo-9-erp-on-ubuntu-14-04. So that the CI server can stop/start odoo server easily. 

I still struggling with #2 but cannot run the server successfully yet. Does anyone have experience automate the odoo build before and share the experience with me ?

Thanks a lot in advance. 


0
Avatar
Opusti
Avatar
Mateo Tibaquira
Best Answer

I recommend you to visit Yenthe's Blog (www.odoo.yenthevg.com), where he got some clean tutorials on Odoo installation.

0
Avatar
Opusti
Avatar
erpdodo
Best Answer

Hi Hieu Lam,

you can create odoo script start in ubuntu by:

create file bash:

#!/bin/bash

### BEGIN INIT INFO

# Provides: odoo

# Required-Start: $remote_fs $syslog

# Required-Stop: $remote_fs $syslog

# Default-Start: 2 3 4 5

# Default-Stop: 0 1 6

# Short-Description: Start odoo daemon at boot time# Description: Enable service provided by daemon.

# X-Interactive: true

### END INIT INFO

## more info: http://wiki.debian.org/LSBInitScripts

. /lib/lsb/init-functions

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin

DAEMON=/usr/bin/odoo

NAME=odoo

DESC=odoo

CONFIG=/etc/odoo/odoo.conf

LOGFILE=/var/log/odoo/odoo-server.log

PIDFILE=/var/run/${NAME}.pid

USER=odoo

export LOGNAME=$USER

test -x $DAEMON || exit 0set -e

function _start() {

    start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER:$USER --background --make-pidfile --exec $DAEMON -- --config $CONFIG --logfile $LOGFILE

}

function _stop() {

    start-stop-daemon --stop --quiet --pidfile $PIDFILE --oknodo --retry 3

     rm -f $PIDFILE}

function _status() {

    start-stop-daemon --status --quiet --pidfile $PIDFILE

    return $?

}

case "$1" in

        start)

                echo -n "Starting $DESC: "

                _start echo "ok"

                ;;

        stop)

                echo -n "Stopping $DESC: "

                _stop echo "ok"

                ;;

        restart|force-reload)

                echo -n "Restarting $DESC: "

                _stop sleep 1

                _start echo "ok"

                ;;

        status)

                echo -n "Status of $DESC: "

                _status && echo "running" || echo "stopped"

                ;;

        *)    

                N=/etc/init.d/$NAME echo "Usage: $N {start|stop|restart|force-reload|status}" >&2

                exit 1 ;;

esac

exit 0


This file in source odoo: /odoo/debian/init

put file in /etc/init.d/<file name>

after run: /etc/init.d/<file name> start


hope to help you.

0
Avatar
Opusti
Avatar
Hieu Lam
Avtor Best Answer

Hi all, 

After lots of time on #2 approach, I still cannot make odoo running in daemon thread. So I switch back to #1 and this is the final script that work for me. If you are in the same situation, hope that help. 


#!bin/bash

sudo kill -9 /var/run/odoo-server.pid

/opt/odoo/odoo-server/odoo.py -d <db_name> -r <db_user> -w <db_password> --addons-path <addons path> -u <modules to update upon startup> > /var/log/odoo/odoo-server.log 2>&1 & 

echo $! > /var/run/odoo-server.pid


0
Avatar
Opusti
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Prijavi
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now