fix: allow alternative items when using job card (#26724)

This commit is contained in:
Ankush 2021-08-09 10:46:29 +05:30 committed by GitHub
parent 16d4de5130
commit 7e0c57fa3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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