From c5cf428d005278339695a1667eb840a201b73a84 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Fri, 24 Aug 2018 11:27:41 +0530 Subject: [PATCH] [Enhance] Provision to backflush raw materials from WIP warehouse (#15184) --- .../doctype/work_order/work_order.json | 35 ++++++++++++++++++- .../stock/doctype/stock_entry/stock_entry.py | 3 +- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/erpnext/manufacturing/doctype/work_order/work_order.json b/erpnext/manufacturing/doctype/work_order/work_order.json index 1214191ad6..0628b2cc0f 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.json +++ b/erpnext/manufacturing/doctype/work_order/work_order.json @@ -519,6 +519,39 @@ "translatable": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "skip_transfer", + "fieldname": "from_wip_warehouse", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Backflush raw materials from work-in-progress warehouse", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_in_quick_entry": 0, @@ -1606,7 +1639,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-07-19 11:08:32.198681", + "modified": "2018-08-21 18:25:04.157070", "modified_by": "Administrator", "module": "Manufacturing", "name": "Work Order", diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 687790be32..2dd9e57c50 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -689,8 +689,9 @@ class StockEntry(StockController): from `tabPurchase Order` po, `tabPurchase Order Item Supplied` poitemsup where po.name = poitemsup.parent and po.name = %s""",self.purchase_order)) + for item in itervalues(item_dict): - if self.pro_doc and not self.pro_doc.skip_transfer: + if self.pro_doc and (cint(self.pro_doc.from_wip_warehouse) or not self.pro_doc.skip_transfer): item["from_warehouse"] = self.pro_doc.wip_warehouse #Get Reserve Warehouse from PO if self.purchase_order and self.purpose=="Subcontract":