Pass CoA display name instead of filename

erpnext's get_chart() iterates verified/*.json and matches on the JSON's `name` field,
not the filename. az_locale ships az_chart_of_accounts.json whose `name` is
"Azerbaijan Republic", so passing the filename made get_chart() return None and the
Company on_update hook crashed with "NoneType.get". make_records swallowed the
exception, Company never inserted, and downstream setup_wizard_complete hooks failed
loudly with "Company not found".

Bump to 0.0.3.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ali 2026-04-22 13:28:16 +00:00
parent 6c687af420
commit bce6e785e0
2 changed files with 6 additions and 3 deletions

View File

@ -1 +1 @@
__version__ = "0.0.2" __version__ = "0.0.3"

View File

@ -10,7 +10,7 @@ frappe.provide("jey_wizard");
// Bump this string in every commit that changes wizard code. Displayed in the footer so // Bump this string in every commit that changes wizard code. Displayed in the footer so
// we can tell at a glance which version is actually running on a given machine. Kept in // we can tell at a glance which version is actually running on a given machine. Kept in
// sync with __version__ in jey_wizard/__init__.py. // sync with __version__ in jey_wizard/__init__.py.
const JEY_WIZARD_VERSION = "0.0.2"; const JEY_WIZARD_VERSION = "0.0.3";
// Wipe Frappe + ERPNext default slides so their `before_load`/`after_load` listeners // Wipe Frappe + ERPNext default slides so their `before_load`/`after_load` listeners
// don't try to mutate a wizard that isn't slide-based anymore. // don't try to mutate a wizard that isn't slide-based anymore.
@ -162,7 +162,10 @@ frappe.setup.SetupWizard = class JeySetupWizard {
password: "", password: "",
company_name: company, company_name: company,
company_abbr: abbr, company_abbr: abbr,
chart_of_accounts: "az_chart_of_accounts", // This must be the `name` FIELD from inside the JSON chart file, not the
// filename. erpnext's get_chart() iterates verified/*.json and matches on
// the "name" key. az_locale's az_chart_of_accounts.json has name="Azerbaijan Republic".
chart_of_accounts: "Azerbaijan Republic",
fy_start_date: `${year}-01-01`, fy_start_date: `${year}-01-01`,
fy_end_date: `${year}-12-31`, fy_end_date: `${year}-12-31`,
setup_demo: 0, setup_demo: 0,