From 74c817e7f90cb02b4ea2a695ee797df950d88004 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 13 Mar 2018 17:10:14 +0530 Subject: [PATCH] Update update_reserved_qty_for_purchase_order.py --- .../v10_0/update_reserved_qty_for_purchase_order.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/erpnext/patches/v10_0/update_reserved_qty_for_purchase_order.py b/erpnext/patches/v10_0/update_reserved_qty_for_purchase_order.py index 681296de888..b0df91890bc 100644 --- a/erpnext/patches/v10_0/update_reserved_qty_for_purchase_order.py +++ b/erpnext/patches/v10_0/update_reserved_qty_for_purchase_order.py @@ -37,8 +37,11 @@ def execute(): and po.is_subcontracted = "Yes" and po.docstatus = 1"""), as_dict=1) for d in item_wh_bin: - stock_bin = get_bin(d["rm_item_code"], d["reserve_warehouse"]) - stock_bin.update_reserved_qty_for_sub_contracting() + try: + stock_bin = get_bin(d["rm_item_code"], d["reserve_warehouse"]) + stock_bin.update_reserved_qty_for_sub_contracting() + except: + pass def get_warehouse(item_code, company, company_warehouse, item_wh): reserve_warehouse = item_wh.get(item_code) @@ -46,4 +49,4 @@ def get_warehouse(item_code, company, company_warehouse, item_wh): reserve_warehouse = None if not reserve_warehouse: reserve_warehouse = company_warehouse.get(company) - return reserve_warehouse \ No newline at end of file + return reserve_warehouse