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

Cron job completes Instantly on production without throwing errors – works correctly on dev

Subscribe

Get notified when there's activity on this post

This question has been flagged
developmentconfigurationfunctiondebug
2 Replies
1216 Views
Avatar
stefan

Hello,

I am facing the following issue:

I have a cron job that runs perfectly on our development instance. On dev, it takes around 20 minutes to complete. However, when I start it manually on our production instance, it completes instantly without actually performing any work.

Here are the logs from the production instance when I trigger the job manually:

2025-09-12 15:06:37,827 1044751 INFO webx odoo.addons.base.models.ir_cron: Manually starting job `OrgaMax Sync`.
2025-09-12 15:06:37,829 1044751 INFO webx odoo.addons.base.models.ir_cron: Job `OrgaMax Sync` done.

Notice that there are no errors in the logs or in the UI.

Cron job XML definition:

<odoo>
    <record id="orgamax_sync" model="ir.cron">
        <field name="name">OrgaMax Sync</field>
        <field name="active" eval="True"/>
        <field name="state">code</field>
        <field name="model_id" ref="model_orgamax_sync"/>
        <field name="code">model.sync_customers()</field>
        <field name="interval_number">1</field>
        <field name="interval_type">days</field>
        <field name="user_id" ref="base.user_root"/>
        <field name="priority">1</field>
    </record>
</odoo>

Model snippet:

import fdb
import logging
import time
from odoo import models, api

_logger = logging.getLogger(__name__)

class OrgaMaxSync(models.Model):
    _name = "orgamax_sync"
    _description = "Sync customers from OrgaMax to Odoo"

    @api.model
    def sync_customers(self):
        _logger.info("STARTING JOB")
        start = time.time()
        ...

The rest of the sync_customers code is not very relevant since, as you can see, the log message "STARTING JOB" is never printed on production.
But there is error handling in the form of Try Except blocks which also log any erros using _logger.error

Module structure:

__manifest__.py
{
    "name": "OrgaMaxSync",
    "data": [
        "data/ir_cron_data.xml"
    ]
}

__init__.py
from . import models

models/__init__.py
from . import OrgaMaxSync

The even stranger part is that this cron used to run on production but would eventually timeout. To fix that, I increased the CPU time in odoo.conf to 30 minutes. After that, the cron started behaving this way. I reverted the odoo.conf settings back to the previous state, but the cron job still finishes instantly.

I also tried setting the next execution time in the UI to 5 minutes in the future, but it still does not execute automatically. The cron is enabled (active=True).

I am on Odoo 17.

Has anyone experienced this before or have any idea why the cron would immediately finish without logging anything?

0
Avatar
Discard
Avatar
stefan
Author Best Answer

The solution was to simply uninstall the module and install it again, it now works as expected. 

1
Avatar
Discard
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,


On development, the cron job runs fine and takes about 20 minutes, but on production it finishes instantly without doing any work and the expected log message never appears. The cron used to run but stopped after changes were made to the odoo.conf file. Reverting the configuration didn’t fix the problem, and no errors show up in the logs or the UI.


The most likely causes are that the cron record is no longer correctly linked to the model, the model is not imported or loaded properly, the cron is running under a user with insufficient permissions, the cron registry cache has not refreshed, or the cron record itself has become corrupted.


To debug, you should check the scheduled action in Settings → Technical → Automation → Scheduled Actions to confirm the model and code are correct. You can also test in Odoo Shell whether the model orgamax_sync exists and whether calling sync_customers() directly works. If it does, the issue lies in the cron link; if not, the model may not be loaded. Changing the cron user, forcing a module reload with -u, or deleting and recreating the cron are recommended next steps.


In summary, the issue comes down to the cron record not being correctly tied to the model or method in production. Recreating or updating the scheduled action so it points properly to orgamax_sync.sync_customers should resolve the problem.


Hope it helps

0
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
[Aide] Modules custom non détectés ou non exécutés sur Odoo 18 (Windows)
development configuration debug
Avatar
Avatar
1
Oct 25
796
My Custom Module don't show in apps list after update.
development configuration debug
Avatar
Avatar
Avatar
2
Aug 25
1463
Creating a field in res.user is throwing internal server error
development configuration debug
Avatar
Avatar
Avatar
2
Jun 25
1560
technical problems
configuration function debug
Avatar
Avatar
1
Mar 25
1845
Updating acc_holder_name via external function
javascript development configuration accounting function debug
Avatar
0
Sep 25
748
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