fix fetch material request items logic

This commit is contained in:
Zlash65 2018-12-13 18:31:05 +05:30
parent 58a4f0e157
commit 82e01bc923

View File

@ -514,7 +514,7 @@ def get_items_for_material_requests(doc, company=None):
doc = frappe._dict(json.loads(doc))
doc['mr_items'] = []
po_items = doc['po_items'] if doc.get('po_items') else doc['items']
po_items = doc.get('po_items') if doc.get('po_items') else doc.get('items')
for data in po_items:
warehouse = None
@ -533,10 +533,10 @@ def get_items_for_material_requests(doc, company=None):
else:
planned_qty = data.get('planned_qty')
bom_no = data.get('bom_no')
include_subcontracted_items = doc['include_subcontracted_items']
company = doc['company']
include_non_stock_items = doc['include_non_stock_items']
ignore_existing_ordered_qty = doc['ignore_existing_ordered_qty']
include_subcontracted_items = doc.get('include_subcontracted_items')
company = doc.get('company')
include_non_stock_items = doc.get('include_non_stock_items')
ignore_existing_ordered_qty = doc.get('ignore_existing_ordered_qty')
if not planned_qty:
frappe.throw(_("For row {0}: Enter Planned Qty").format(data.get('idx')))