Bỏ qua để đến Nội dung
Odoo Menu
  • Đăng nhập
  • Dùng thử miễn phí
  • Ứng dụng
    Tài chính
    • Kế toán
    • Hóa đơn
    • Chi phí
    • Bảng tính (BI)
    • Tài liệu
    • Ký tên
    Bán hàng
    • CRM
    • Bán hàng
    • POS Cửa hàng
    • POS Nhà hàng
    • Đăng ký
    • Cho thuê
    Trang web
    • Trình tạo trang web
    • Thương mại điện tử
    • Blog
    • Diễn đàn
    • Trò chuyện trực tiếp
    • Học trực tuyến
    Chuỗi cung ứng
    • Tồn kho
    • Sản xuất
    • PLM
    • Mua hàng
    • Bảo dưỡng
    • Chất lượng
    Nhân sự
    • Nhân viên
    • Tuyển dụng
    • Ngày nghỉ
    • Đánh giá
    • Giới thiệu
    • Đội xe
    Marketing
    • Marketing trên MXH
    • Marketing qua email
    • Marketing qua SMS
    • Sự kiện
    • Tự động hóa Marketing
    • Khảo sát
    Dịch vụ
    • Dự án
    • Bảng chấm công
    • Dịch vụ hiện trường
    • Hỗ trợ
    • Kế hoạch
    • Lịch hẹn
    Năng suất
    • Thảo luận
    • Phê duyệt
    • IoT
    • VoIP
    • Kiến thức
    • WhatsApp
    Ứng dụng của bên thứ ba Studio Odoo Nền tảng Đám mây Odoo
  • Ngành
    Bán lẻ
    • Nhà sách
    • Cửa hàng quần áo
    • Cửa hàng nội thất
    • Cửa hàng tạp hóa
    • Cửa hàng đồ kim khí
    • Cửa hàng đồ chơi
    Ẩm thực & Dịch vụ lưu trú
    • Bar và quán rượu
    • Nhà hàng
    • Đồ ăn nhanh
    • Guest house
    • Nhà phân phối đồ uống
    • Khách sạn
    Bất động sản
    • Công ty môi giới bất động sản
    • Công ty kiến trúc
    • Xây dựng
    • Quản lý bất động sản
    • Làm vườn
    • Hiệp hội chủ sở hữu bất động sản
    Tư vấn
    • Công ty kế toán
    • Đối tác Odoo
    • Công ty marketing
    • Công ty luật
    • Tuyển dụng
    • Thanh tra & chứng nhận
    Sản xuất
    • Dệt may
    • Kim loại
    • Nội thất
    • Ẩm thực
    • Nhà máy bia
    • Quà tặng doanh nghiệp
    Sức khoẻ & fitness
    • CLB thể thao
    • Cửa hàng kính mắt
    • Trung tâm fitness
    • Chuyên gia chăm sóc sức khỏe
    • Hiệu thuốc
    • Tiệm làm tóc
    Thương mại
    • Dịch vụ sửa chữa
    • Phần cứng CNTT & Hỗ trợ
    • Hệ thống năng lượng mặt trời
    • Công ty sản xuất giày
    • Dịch vụ vệ sinh
    • Dịch vụ HVAC
    Khác
    • Tổ chức phi lợi nhuận
    • Cơ quan môi trường
    • Cho thuê biển quảng cáo
    • Nhiếp ảnh
    • Cho thuê xe đạp
    • Đại lý phần mềm
    Xem tất cả ngành
  • Cộng đồng
    Học tập
    • Khóa học
    • Tài liệu
    • Chứng chỉ
    • Đào tạo
    • Blog
    • Podcast
    Thúc đẩy đào tạo
    • Chương trình đào tạo
    • Trò chơi kinh doanh Scale Up!
    • Tham quan Odoo
    Nhận phần mềm
    • Tải xuống
    • So sánh các phiên bản
    • Phiên bản
    Hợp tác
    • Github
    • Diễn đàn
    • Sự kiện
    • Dịch thuật
    • Trở thành đối tác
    • Dịch vụ dành cho Đối tác
    • Đăng ký công ty kế toán của bạn
    Nhận dịch vụ
    • Tìm đối tác
    • Tìm kế toán
    • Gặp chuyên gia hỗ trợ
    • Dịch vụ Triển khai
    • Khách hàng tham khảo
    • Hỗ trợ
    • Nâng cấp
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Nhận một buổi demo
  • Bảng giá
  • Trợ giúp

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

  • CRM
  • e-Commerce
  • Kế toán
  • Tồn kho
  • PoS
  • Dự án
  • MRP
All apps
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Hỗ trợ

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

Đăng ký nhận tin

Nhận thông báo khi có hoạt động trên bài viết này

Câu hỏi này đã bị gắn cờ
developmentconfigurationfunctiondebug
2 Trả lời
1138 Lượt xem
Ảnh đại diện
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
Ảnh đại diện
Huỷ bỏ
Ảnh đại diện
stefan
Tác giả Câu trả lời hay nhất

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

1
Ảnh đại diện
Huỷ bỏ
Ảnh đại diện
Cybrosys Techno Solutions Pvt.Ltd
Câu trả lời hay nhất

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
Ảnh đại diện
Huỷ bỏ
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!

Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!

Đăng ký
Bài viết liên quan Trả lời Lượt xem Hoạt động
[Aide] Modules custom non détectés ou non exécutés sur Odoo 18 (Windows)
development configuration debug
Ảnh đại diện
Ảnh đại diện
1
thg 10 25
698
My Custom Module don't show in apps list after update.
development configuration debug
Ảnh đại diện
Ảnh đại diện
Ảnh đại diện
2
thg 8 25
1321
Creating a field in res.user is throwing internal server error
development configuration debug
Ảnh đại diện
Ảnh đại diện
Ảnh đại diện
2
thg 6 25
1513
technical problems
configuration function debug
Ảnh đại diện
Ảnh đại diện
1
thg 3 25
1780
Updating acc_holder_name via external function
javascript development configuration accounting function debug
Ảnh đại diện
0
thg 9 25
706
Cộng đồng
  • Khóa học
  • Tài liệu
  • Diễn đàn
Open source
  • Tải xuống
  • Github
  • Runbot
  • Dịch thuật
Dịch vụ
  • Lưu trữ Odoo.sh
  • Hỗ trợ
  • Nâng cấp
  • Phát triển tùy chỉnh
  • Đào tạo
  • Tìm kế toán
  • Tìm đối tác
  • Trở thành đối tác
Giới thiệu công ty
  • Công ty của chúng tôi
  • Tài sản thương hiệu
  • Liên hệ
  • Việc làm
  • Sự kiện
  • Podcast
  • Blog
  • Khách hàng
  • Pháp lý • Riêng tư
  • Bảo mật
الْعَرَبيّة 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 là bộ ứng dụng kinh doanh có open source đáp ứng tất cả các nhu cầu của công ty bạn: CRM, thương mại điện tử, kế toán, tồn kho, POS, quản lý dự án, v.v.

Định hướng giá trị riêng biệt của Odoo là tích hợp hoàn toàn và dễ dàng sử dụng.

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