Files
erpnext/erpnext/startup
Mihir Kandoi ce2e7fb7ee refactor(startup): convert boot_session raw SQL to ORM (Postgres-valid)
boot_session used raw `frappe.db.sql`, including a MySQL-only
`ifnull(account_type, '')` over Party Type that is invalid on Postgres.

- customer_count: `SELECT count(*)` → `frappe.db.count`
- setup_complete: `SELECT name ... LIMIT 1` → `frappe.db.get_all(limit=1)`
- companies: raw select → `frappe.get_all`, preserving the `:Company`
  virtual-doc marker
- party_account_types: `ifnull(account_type,'')` → `frappe.get_all` with a
  Python `account_type or ""`, which collapses NULL→'' and ''→''
  identically on both engines (handles Postgres storing '' as NULL)

Adds a test (no test file existed) that runs boot_session and asserts the
company list and party_account_types are populated, on both engines.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 05:03:47 +05:30
..
2022-03-28 18:52:46 +05:30
2021-11-05 11:16:29 +05:30
2022-03-28 18:52:46 +05:30