From a8060d5e996e1698ac6bdb2e872a70b079ef67aa Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Sun, 9 Aug 2026 21:22:17 +0530 Subject: [PATCH] fix(manufacturing): adapt version 16 compatibility --- erpnext/manufacturing/doctype/bom/bom.py | 2 +- erpnext/stock/doctype/stock_entry/stock_entry.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index a706f5daa13..06f7ff894d6 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -854,7 +854,7 @@ class BOM(WebsiteGenerator): self.add_materials_from_bom(row.finished_good, row.bom_no, row.idx, qty=row.finished_good_qty) @frappe.whitelist() - def add_raw_materials(self, operation_row_id: str, items: str | list[dict]) -> None: + def add_raw_materials(self, operation_row_id: str | int, items: str | list[dict]) -> None: if isinstance(items, str): items = parse_json(items) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 0c6c3bbee9b..cd442909b1c 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -3238,7 +3238,8 @@ class StockEntry(StockController, SubcontractingInwardController): entry_qty = flt(finished_qty + flt(self.process_loss_qty), precision) if entry_qty > pending_qty: - uom = job_card.stock_uom + item_code = job_card.finished_good or job_card.production_item + uom = frappe.get_cached_value("Item", item_code, "stock_uom") frappe.throw( _( "The Job Card {0} has only {1} left to produce, but this entry books {2} ({3} finished goods and {4} process loss). Cancel or update its other manufacture entries first."