Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

Cron job not working in Odoo 15

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
v15
3 Odpowiedzi
8185 Widoki
Awatar
MercTrans

I tried to create a cron job in Odoo 15 and it is not working at all even though the terminal returns that the cron job was executed. 


I used this in my "automation.xml" file: 

noupdate="0">
id="ir_cron_scheduler_sync_status_action" model="ir.cron">
name="name">Auto Sync Payment Status
name="model_id" ref="model_model_name"/>
name="state">code
name="code">model.test_cron()
name="user_id" ref="base.user_root"/>
name="interval_number">1
name="interval_type">minutes
name="numbercall">-1

And my function is as simple as this:

@api.model
def test_cron(self):
print("test cron")


But when I run this scheduled action manually or I just let the server executes it, nothing is printed in the terminal. What might be the issue here? Please help!


0
Awatar
Odrzuć
Awatar
shubham shiroya
Najlepsza odpowiedź

Here are some possible solutions to troubleshoot the issue:

  1. Check Cron Configuration: Ensure that your cron job is properly configured in the automation.xml file. Double-check the correctness of the element structure and attributes, such as name, model_id, state, code, user_id, interval_number, and interval_type.log files are located in the Odoo installation directory. Look for any relevant entries that may provide insights into the issue.

  2. Enable Developer Mode: Enable the developer mode in Odoo to see detailed error messages. You can enable it by adding ?debug at the end of the URL or by activating the developer mode through the user interface (by going to "Settings" -> "Activate the Developer Mode").

  3. Restart Odoo Service: Restart the Odoo service to ensure that any changes made to the cron job or module are properly applied. Sometimes, changes may not take effect until the service is restarted.

  4. Verify Access Rights: Ensure that the user specified in the user_id attribute of the cron job has the necessary access rights to execute the job. The user should have appropriate permissions on the model and its associated methods.

  5. Check Server Timezone: Make sure the server's timezone is correctly set. Cron jobs in Odoo are executed based on the server's timezone configuration. Verify that the timezone is set correctly in the Odoo configuration file (odoo.conf).


0
Awatar
Odrzuć
Awatar
Christopher DATO
Najlepsza odpowiedź

Sorry for the late response,
The print() function won't display anything in odoo log file.
You should use a logging function to display infos in odoo log.

See example below:

import logging
_logger=logging.getLogger(__name__) 
_logger.info("MY FIRST INFO LOG")

I hope I've helped you...

0
Awatar
Odrzuć
Awatar
Najlepsza odpowiedź

Hello,

For the XML code:

 


For the python code:

@api.model
def test_cron(self):
print("test cron")

Be sure that the xmlfile is imported in the _manifest.py and the python file is imported in the __init_.py file.

For the model_id in the xml file:

You have to set model.model_name where the model is the name of your application and model_name is the name of your model where the function test_cron is declared.


Best regards,

Imal-Tech
 
Imal-Tech team




0
Awatar
Odrzuć
MercTrans
Autor

The problem is I already added the xml file and python file to manifest and init. The cron job actually runs but it doesn't execute the function.

MercTrans
Autor

odoo_web | 2022-10-23 04:03:17,213 43 INFO merctrans odoo.addons.base.models.ir_cron: Starting job `Auto Sync Payment Status`.
odoo_web | 2022-10-23 04:03:17,215 43 INFO merctrans odoo.addons.base.models.ir_cron: Job `Auto Sync Payment Status` done.
odoo_web | 2022-10-23 04:04:20,286 43 INFO merctrans odoo.addons.base.models.ir_cron: Starting job `Auto Sync Payment Status`.
odoo_web | 2022-10-23 04:04:20,287 43 INFO merctrans odoo.addons.base.models.ir_cron: Job `Auto Sync Payment Status` done.
odoo_web | 2022-10-23 04:05:23,444 43 INFO merctrans odoo.addons.base.models.ir_cron: Starting job `Auto Sync Payment Status`.
odoo_web | 2022-10-23 04:05:23,451 43 INFO merctrans odoo.addons.base.models.ir_cron: Job `Auto Sync Payment Status` done.
odoo_web | 2022-10-23 04:06:26,610 43 INFO merctrans odoo.addons.base.models.ir_cron: Starting job `Auto Sync Payment Status`.
odoo_web | 2022-10-23 04:06:26,617 43 INFO merctrans odoo.addons.base.models.ir_cron: Job `Auto Sync Payment Status` done.
odoo_web | 2022-10-23 04:06:32,467 44 INFO merctrans odoo.addons.base.models.ir_cron: Starting job `Auto Sync Payment Status`.
odoo_web | 2022-10-23 04:06:32,481 44 INFO merctrans odoo.addons.base.models.ir_cron: Job `Auto Sync Payment Status` done.

You can see here that the cron job runs, but doesn't print anything to terminal

Jakub Sedinar

Hi, did you manage to fix it? or do you need help?

Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
Prevent navigation if records are not save
v15
Awatar
Awatar
Awatar
2
paź 25
3503
Creating user creates duplicated partner_id
v15
Awatar
Awatar
1
wrz 25
3370
Sales order line comment to Purchase order line comment Rozwiązane
v15
Awatar
Awatar
3
lip 25
4570
attribute is not applied when dynamically rendering
v15
Awatar
1
maj 25
2714
Odoo Custome Module Language Creation
v15
Awatar
Awatar
Awatar
Awatar
4
maj 25
4152
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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