fix(manufacturing): account for process loss in plan progress by Pandiyan5273 · Pull Request #61773 · frappe/erpnext · GitHub
Skip to content

fix(manufacturing): account for process loss in plan progress - #61773

Merged
mergify[bot] merged 8 commits into
frappe:developfrom
aerele:fix/production-plan-visualizer-process-loss
Oct 21, 2026
Merged

mergify[bot] merged 8 commits into
frappe:developfrom
aerele:fix/production-plan-visualizer-process-loss

Conversation

@Pandiyan5273

Copy link
Copy Markdown
Member

Issue

  • The Production Plan Visualizer ignores Work Order process loss when calculating pending quantities and completion percentages. As a result, completed production can still appear pending.

Steps to replicate

  1. Create and submit a Production Plan for 10 units.
  2. Create a Work Order from the plan.
  3. Complete manufacturing with 9 units produced and 1 unit recorded as process loss.
  4. Open the Production Plan Visualizer and select the plan.

Actual behavior

  • The visualizer shows 1 unit pending and 90% complete, even though the Work Order is complete.

Expected behavior

  • The visualizer shows 0 pending and 100% completion. Actual produced quantity remains 9.

No Backport needed

@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

@Pandiyan5273
Pandiyan5273 force-pushed the fix/production-plan-visualizer-process-loss branch from cc17002 to d45c6b3 Compare October 21, 2026 10:49
@mihir-kandoi

mihir-kandoi commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Note

Auto-generated review.

Verdict: Approve

Reproduced on develop: plan for 10, BOM with 10% process loss, WO completed with 9 produced / 1 lost. Visualizer shows 90% and 1 pending. With this PR, 100% and 0 pending, in both console and browser. A replacement WO for the lost unit also stays at 100%. The visualizer is develop-only, so no backport.

Pushed:

  • 91bb5da: reuse get_produced_and_pending_qty from the Production Plan Summary report instead of copying its unreplaced-loss logic twice. Row completion in JS now comes from pending_qty, so the extra unreplaced_loss_qty field is gone.
  • 6c70d10: the finished-good row still said "In progress" at 100%. It now uses pending_qty for the "Completed" label.
  • de675b8, b71ce74: plan completion is now worked out from all of the plan's Work Orders, not just the ones the user can read. Otherwise a user who can't read some or all Work Orders saw 0%, 90% or 110% for a fully done plan.
  • 90fd5b0, 0b9c328: trimmed the test to one row-level case. The replacement cases are already covered by the report tests.

@mihir-kandoi mihir-kandoi added the auto reviewed PR was automatically reviewed by AI agents. label Oct 21, 2026

@mihir-kandoi mihir-kandoi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reproduced and verified the fix; review fixes pushed.

@mihir-kandoi

Copy link
Copy Markdown
Collaborator

@Mergifyio queue

@mergify

mergify Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

@mergify
mergify Bot merged commit a450b58 into frappe:develop Oct 21, 2026
16 checks passed
@mergify mergify Bot removed the queued label Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto reviewed PR was automatically reviewed by AI agents.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants