From 2548751673d7853ce5f282bd32fa1746f3019f20 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Sat, 8 Aug 2026 16:25:04 +0530 Subject: [PATCH] fix: generate the next manufacture entry net of booked process loss After a partial entry booked the job card's full process loss, the next generated entry was sized qty-to-produce minus manufactured only. It exceeded the pending production cap, so Make Stock Entry could not finish the card. Subtract the consumed loss when sizing the entry. (cherry picked from commit b8dd886cd424e3347a92a7eff4f357758197f1f3) # Conflicts: # erpnext/manufacturing/doctype/job_card/job_card.py --- erpnext/manufacturing/doctype/job_card/job_card.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/erpnext/manufacturing/doctype/job_card/job_card.py b/erpnext/manufacturing/doctype/job_card/job_card.py index 61577623236..512de2ee2db 100644 --- a/erpnext/manufacturing/doctype/job_card/job_card.py +++ b/erpnext/manufacturing/doctype/job_card/job_card.py @@ -1674,10 +1674,18 @@ class JobCard(Document): from erpnext.stock.doctype.stock_entry_type.stock_entry_type import ManufactureEntry +<<<<<<< HEAD ste = ManufactureEntry( { "for_quantity": self.for_quantity - self.manufactured_qty, "process_loss_qty": max(self.process_loss_qty - get_consumed_process_loss(), 0), +======= + consumed_process_loss = self.get_consumed_process_loss() + return ManufactureEntry( + { + "for_quantity": self.get_qty_to_produce() - self.manufactured_qty - consumed_process_loss, + "process_loss_qty": max(self.process_loss_qty - consumed_process_loss, 0), +>>>>>>> b8dd886cd4 (fix: generate the next manufacture entry net of booked process loss) "job_card": self.name, "skip_material_transfer": self.skip_material_transfer, "backflush_from_wip_warehouse": self.backflush_from_wip_warehouse,