jey_erp/jey_erp/setup
Ali 91268cc466 feat(default-data): auto-sync leave types and company defaults on migrate
Mirrors the salary-component pattern for two more pieces of master data:

- sync_leave_types(): full upsert from default_data/leave_types.json.
  Creates missing, updates existing, deletes those no longer in JSON.
  Leave Type has no `disabled` field, so when a deletion fails due to
  linked Leave Allocation/Application records, the sync logs and skips
  (vs. marking disabled like Salary Component does).

- sync_company_defaults(): for every Company, resolves each account_number
  in default_data/company_defaults.json to the company-scoped Account
  name and sets the corresponding Company field. Non-destructive: if
  the company has no account with that number, the field is left as-is.

Both hooked into after_migrate_combined after sync_salary_components,
since Leave Type's earning_component references a Salary Component.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 12:55:27 +00:00
..
__init__.py monkey patched asset categories 2026-01-09 22:58:43 +04:00
setup_wizard_handler.py feat(default-data): auto-sync leave types and company defaults on migrate 2026-05-01 12:55:27 +00:00