Skip to content

AGM & scheduler

Document AGM-related automation: scheduled job entry points and known issues with on_update handlers tied to auto-email.

  • leekimerp/scheduler_events/agm_legacy.pyagm_conditional_legacy and related ACRA data logic
  • leekimerp/lee_kim_alliance_erp/doctype/agm/ — AGM DocType controllers
  • hooks.py — commented "AGM": {"on_update": "leekimerp.tasks.after_agm_update_generate_auto_email"}
CronHandler
0 7 * * *leekimerp.scheduler_events.agm_legacy.agm_conditional_legacy
flowchart LR
CRON[Daily 07:00] --> AGM[agm_conditional_legacy]
AGM --> ACRA[ACRA API / token helpers]
AGM --> DOCS[AGM DocType updates]

agm_legacy.py imports get_simple_acra_api_token, make_simple_acra_request_return_data, and analyze_table_fields from lee_kim_alliance_erp.doctype.agm.agm.

  • after_agm_update_generate_auto_email is disabled on AGM on_update because it was observed to break the cron job (agm_conditional_cron): the job could halt or get stuck.
  • Same problem was reported when moving that logic to agm.py on_update.
  • Do not re-enable without fixing root cause and load-testing the scheduler.
  • Cron: Frappe scheduler worker must be running.
  • Desk: Manual AGM documents as per business process.
  • ACRA settings and API tokens (see agm.py and related DocTypes)
  • Monitor scheduler logs after any change to AGM hooks or tasks related to auto-email.