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:
Frappe PR Bot 2021-08-09 11:33:55 +05:30 committed by GitHub
parent bba9aac9c0
commit 3dfbf19e8f
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