fix(setup): unblock setup wizard with TT200 CoA + defer account setup #136
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/wizard-tt200-compat"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
See commits for detail. Fixes 3 install-wizard bugs: ERPNext sync_financial_report_templates NoneType crash, create_default_tax_template IndexError, account 4131 name >140 chars, plus ensure_payroll_accounts race condition via enqueue_after_commit.
ERPNext v16 setup wizard crashes when user selects vhrms's 'Vietnam - Hệ thống tài khoản theo Thông tư 200/2014/TT-BTC' chart of accounts. Root causes: 1. sync_financial_report_templates calls get_chart() via direct Python import — bypasses our override_whitelisted_methods mapping (which only covers API endpoints) → returns None for TT200 CoA → 'NoneType' object has no attribute 'get'. Patched by monkey-patching the module attribute at vhrms boot so any direct import resolves to vhrms's chart-aware loader. 2. create_default_tax_template assumes English account names 'Duties and Taxes' (Liability) / 'Tax Assets' (Asset) — TT200 uses Vietnamese names (333, 133) → empty query → IndexError. Patched by skipping for TT200 CoA (admin tạo Sales/Purchase Tax Template thủ công sau setup). 3. Account 4131 name exceeded 140-char Frappe limit (175 chars w/ account_number prefix + company abbr suffix), halting chart import at ~167/200+ accounts. Renamed to 75 chars. Installation flow now works end-to-end: bench new-site --install-app erpnext --install-app hrms --install-app vhrms → user opens site → completes wizard with TT200 CoA → Company created + on_company_created hook seeds Lương Chính thức + Lương Thử việc + VAS account mappings + Vietnam leave types.