Merge pull request #22470 from marination/production-plan-test

fix: Sales Order to MR test failing
This commit is contained in:
rohitwaghchaure 2020-06-26 15:05:53 +05:30 committed by GitHub
commit b47218f7b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -643,7 +643,8 @@ def get_items_for_material_requests(doc, warehouses=None):
doc['mr_items'] = []
po_items = doc.get('po_items')
po_items = doc.get('po_items') if doc.get('po_items') else doc.get('items')
# Check for empty table or empty rows
if not po_items or not [row.get('item_code') for row in po_items if row.get('item_code')]:
frappe.throw(_("Items to Manufacture are required to pull the Raw Materials associated with it."),
title=_("Items Required"))