mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-17 00:25:01 +00:00
fix: allow alternative items when using job card (bp #26724)
(cherry picked from commit 7e0c57fa3f)
Co-authored-by: Ankush <ankush@iwebnotes.com>
This commit is contained in:
@@ -608,6 +608,11 @@ def make_stock_entry(source_name, target_doc=None):
|
||||
target.set_missing_values()
|
||||
target.set_stock_entry_type()
|
||||
|
||||
wo_allows_alternate_item = frappe.db.get_value("Work Order", target.work_order, "allow_alternative_item")
|
||||
for item in target.items:
|
||||
item.allow_alternative_item = int(wo_allows_alternate_item and
|
||||
frappe.get_cached_value("Item", item.item_code, "allow_alternative_item"))
|
||||
|
||||
doclist = get_mapped_doc("Job Card", source_name, {
|
||||
"Job Card": {
|
||||
"doctype": "Stock Entry",
|
||||
@@ -698,4 +703,4 @@ def make_corrective_job_card(source_name, operation=None, for_operation=None, ta
|
||||
}
|
||||
}, target_doc, set_missing_values)
|
||||
|
||||
return doclist
|
||||
return doclist
|
||||
|
||||
Reference in New Issue
Block a user