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> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| setup_wizard_handler.py | ||