Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Real Estate
    • Real Estate Agency
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consulting
    • Accounting Firm
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Solar Energy Systems
    • Shoe Maker
    • Serveis de neteja
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Why do i need to restart Odoo when changing in python files, if python is interpreted?

Subscriure's

Get notified when there's activity on this post

This question has been flagged
odooodoo-11
7 Respostes
21204 Vistes
Avatar
vivek

I've a very basic question of why odoo restart is required when making some changes in python files. I've read this https://www.odoo.com/forum/help-1/question/is-there-a-need-to-restart-openerp-server-when-we-update-a-custom-module-52293, and it says restart is mandatory but didn't say why it's mandatory.

On a running server if i can move a module to addons path and install it (without restarting server) why am i not able to modify python file and upgrade the module.

And if python is interpreted why do i need a restart?

Additionally i've even tried deleting the pycache directory to see if that restricts the interpreter from further compiling it, but it didn't help.

And i'm very clear that module upgradation is required if we modify xml files. No more explanation required on the same. :)

Meanwhile i'm trying to explore if i can modify the python files and tell odoo in someway other than restarting it. Thanks in advance for clarifying me.

0
Avatar
Descartar
Niyas Raphy (Walnut Software Solutions)

To Configure watchdog with Odoo to restart the odoo service automatically, see this: https://www.youtube.com/watch?v=SKwl_pSBy9c

Avatar
Devendra Kavthekar
Best Answer

You will need to install watchdog to have auto reload option working. Watchdog is available on linux. So whenever you save changes to any of the files under watch, the server will be auto restarted.

e.g.  You can see here:

https://www.awesomescreenshot.com/image/3303625/d6a4656e3d85fa5cd797e6efdfe23619

1
Avatar
Descartar
vivek
Autor

Thanks Devendran. Does it work for mac?

Devendra Kavthekar

Yes it works for Mac, you can see here: https://pythonhosted.org/watchdog/installation.html

Avatar
Guillermo Martinez
Best Answer

Hi everyone, --dev reload work with enterprise?

0
Avatar
Descartar
Avatar
Ray Carnes
Best Answer

Python code is compiled, then interpreted.

Python automatically compiles your script to compiled code, a .pyc file, before running it.

When a NEW module is added and seen for the first time, or when the source is more recent than the current compiled file, a .pyc file containing the compiled code will be created in the same directory as the .py file.  This is why a new addon can be copied and installed without a restart.

After compilation, the sources files are not used by the Server.

Use the --dev reload option to automatically restart after changes WHILE DEVELOPING.

https://www.odoo.com/documentation/11.0/reference/cmdline.html

0
Avatar
Descartar
vivek
Autor

Thanks Ray Carnes, but --dev reload option didn't help for me in pycharm. Can you please tell me what i miss? Am using mac by the way.

Avatar
Ajepe Babatope
Best Answer

You do need to restart Odoo if you are working only with the Python files, and this is not only "Odooish" stuff, it's common to all python application Django, Flask, Pyramid etc.

To always be on the safer side, you can add this flag to your odoo startup command --dev=all, this will enable Odoo to keep watch on any changes made to python file(s), and reload the server by itself, but only works for python files, as for xml you may still need to restart.


-1
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

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

Registrar-se
Related Posts Respostes Vistes Activitat
How to get current record ID? Solved
odoo odoo-11
Avatar
Avatar
Avatar
Avatar
4
de des. 23
35123
How to override a JS variable in Odoo 11? Solved
javascript odoo odoo-11
Avatar
1
de nov. 17
5957
How do I go about this error? I am trying to uninstall a module
odoo
Avatar
0
de nov. 25
3278
(#iberia#)¿Cómo llamar a Iberia desde Panamá?
odoo
Avatar
0
d’oct. 25
312
How to import product variants with my own external id when using dynamic creation mode Solved
odoo
Avatar
Avatar
2
d’ag. 25
3853
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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