fix: Validation while getting raw materils for production in Production Plan

This commit is contained in:
dgarg007 2019-02-02 21:57:00 +05:30
parent 752f2f1805
commit f667cff5a6

View File

@ -568,7 +568,11 @@ def get_items_for_material_requests(doc, sales_order=None, company=None):
item_details = get_subitems(doc, data, item_details, bom_no, company, item_details = get_subitems(doc, data, item_details, bom_no, company,
include_non_stock_items, include_subcontracted_items, 1, planned_qty=planned_qty) include_non_stock_items, include_subcontracted_items, 1, planned_qty=planned_qty)
else: else:
item_master = frappe.get_doc('Item', data['item_code']).as_dict() if data['item_code']:
item_master = frappe.get_doc('Item', data['item_code']).as_dict()
else:
frappe.throw(_("Please select items in SELECT ITEMS section"))
purchase_uom = item_master.purchase_uom or item_master.stock_uom purchase_uom = item_master.purchase_uom or item_master.stock_uom
conversion_factor = 0 conversion_factor = 0
for d in item_master.get("uoms"): for d in item_master.get("uoms"):