Note on v1.2.0
This supersedes v1.2.0, which was tagged and then withdrawn. The repository had immutable releases enabled at the time, so deleting the v1.2.0 release left an immutable tag that could not be recreated or moved. v1.2.1 republishes the same work under a fresh version — there is no code difference between the two beyond the version string.
Overview
Adds tooling tracking to the NPD Project Module: a customer-PO tooling order doctype with recovery tracking against payments and invoices, a recovery register report, and Project form integration.
Backward compatible — no breaking changes, no data migration required beyond bench migrate.
What's Changed
Features
NPD Tooling orders (#9)
- New
NPD Toolingdoctype — a customer-PO tooling order with child tool lines, so a part needing several tools (each possibly from a different supplier) is tracked as one order. - Child tables:
NPD Tooling Item(tool lines),NPD Tooling Payment(receipts),NPD Tooling Invoice(billing reference). - Recovery combines money paid against linked Sales Invoices with manual advance allocations, so it counts before a tax invoice exists and never double-counts a Payment Entry already applied to a linked invoice.
- Bulk customer payments can be allocated across multiple tooling POs.
- Recovery is auto-derived from Sales Invoice allocations.
- Seeds a
ToolingItem Group so tool Items classify consistently (create_tooling_item_grouppatch).
Tooling Recovery Register report (#9)
- Recovery status, ageing from the customer PO date, and outstanding amounts across tooling orders.
NPD Tooling in the Project Connections tab (#10)
- Project's Connections tab now surfaces NPD Tooling, via a custom
DocType Linkcreated inafter_install. NPD Tooling.projectmatches the Project dashboard's default fieldname, so the connection count resolves automatically.- An
after_migratehook re-asserts the link on every migrate. This matters becausecustom=1does not survive a doctype re-import: whenproject.jsonchanges, Frappe reloads it viadelete_doc(..., for_reload=True), dropping everyDocType Linkrow on Project. A one-shot patch cannot recover from that once logged.
Packaging
- Declares
[tool.bench.frappe-dependencies]inpyproject.toml(frappeanderpnext, both>=15.0.0,<17.0.0), sobench get-app/bench install-apprejects an unsupported major up front instead of failing at runtime. Previously no compatibility check ran at all. CLAUDE.mdcorrected: it claimed v15 only in three places; both majors are supported.
Fixes
- The connection's idempotency guard matches on
parent+link_doctyperather than pinningcustom=1, so a site carrying the same link as a standard row from fixtures no longer ends up with NPD Tooling listed twice. - Removed a redundant
frappe.db.commit()from theafter_migratehook — migrate already invokes these hooks inside its@atomicphase, and the manual commit partially defeated that rollback.
Uninstall
before_uninstallremoves the Tooling Item Group (only when no Items reference it), the reports, and the custom Project connection (only thecustom=1rows this app creates).
Verification
- Full app suite 72/72 on Frappe/ERPNext v15.
pre-commit run --all-filesclean; Linters and CI green on the release commit.- Connection recovery verified empirically: link deleted on a site whose Patch Log already contained the earlier one-shot patch,
bench migraterestored it and it reappeared in the Project form's Connections.
Upgrading
bench --site <site> migrateFull changelog: v1.1.0...v1.2.1