Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

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

Subscribe

Get notified when there's activity on this post

This question has been flagged
odooodoo-11
7 Replies
21280 Views
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
Discard
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
Discard
vivek
Author

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
Discard
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
Discard
vivek
Author

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
Discard
Enjoying the discussion? Don't just read, join in!

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

Sign up
Related Posts Replies Views Activity
How to get current record ID? Solved
odoo odoo-11
Avatar
Avatar
Avatar
Avatar
4
Dec 23
35155
How to override a JS variable in Odoo 11? Solved
javascript odoo odoo-11
Avatar
1
Nov 17
5992
How do I go about this error? I am trying to uninstall a module
odoo
Avatar
0
Nov 25
3356
How to import product variants with my own external id when using dynamic creation mode Solved
odoo
Avatar
Avatar
2
Aug 25
3930
How to import Bulk Image in Product your local database not any cloud, odoo.sh Solved
odoo
Avatar
Avatar
1
Jul 25
1936
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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