Doc events
Purpose
Section titled “Purpose”Document document lifecycle hooks so engineers know what runs on validate, save, or trash.
Source
Section titled “Source”leekimerp/leekimerp/hooks.py → doc_events
Inventory
Section titled “Inventory”| DocType | Event | Handler(s) |
|---|---|---|
| Sales Invoice | on_update | leekimerp.scripts.sales_invoice.before_submit_sales_invoice |
| Billing | after_insert | leekimerp.tasks.handle_billing |
| Application | on_update | leekimerp.lee_kim_alliance_erp.doctype.application.on_update.generate_pdfs.generate_pdfs |
| Employee | validate | validate_voluntary_contribution, calculate_citizenship_year, create_salary_structure_v2, create_salary_structure_assignment_v2, create_own_holiday_list |
| Employee | after_insert | create_salary_structure_assignment_v2 |
| Salary Slip | validate | setup_payment_days → … → append_salary_slip (see Payroll) |
| Payroll Entry | before_validate | switch_active_salary_structure |
| Payroll Entry | validate | create_payroll_entry_name |
| Payroll Entry | on_trash | on_trash |
| Salary Component | validate | get_abbreviated_name, update_accounts_table |
| Account | after_insert | setup_salary_component |
| Company | after_insert / after_save / on_trash | setup_company, update_company, delete_company |
| Mode of Payment | before_insert | hook_events.mode_of_payment.autonaming |
| User | before_insert | hook_events.user.autonaming |
Commented / disabled
Section titled “Commented / disabled”- AGM
on_update→after_agm_update_generate_auto_email— commented; see Known issues - Auto Email Configuration
on_update— commented
Dependencies
Section titled “Dependencies”Handlers in leekimerp.scripts.*, leekimerp.hook_methods, leekimerp.tasks, etc.
Operational notes
Section titled “Operational notes”Order of validate hooks matters for Salary Slip and Employee; change only with regression tests on payroll.