From 34c218b2de908fe05b4b0f785f34a7d875b921f7 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 22 Aug 2017 19:07:16 +0530 Subject: [PATCH] Minor improvements based on skip_transfer (#10457) --- .../manufacturing/doctype/production_order/production_order.js | 2 +- .../manufacturing/doctype/production_order/production_order.py | 3 ++- .../doctype/production_order_item/production_order_item.json | 3 ++- erpnext/stock/doctype/stock_entry/stock_entry.py | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js index c61eec620a..33acb41d4b 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.js +++ b/erpnext/manufacturing/doctype/production_order/production_order.js @@ -91,7 +91,7 @@ frappe.ui.form.on("Production Order", { frm.set_indicator_formatter('operation', function(doc) { return (frm.doc.qty==doc.completed_qty) ? "green" : "orange" }); }, - + refresh: function(frm) { erpnext.toggle_naming_series(); erpnext.production_order.set_custom_buttons(frm); diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py index 022e9f3d18..5fedc72889 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py @@ -523,7 +523,8 @@ def set_production_order_ops(name): @frappe.whitelist() def make_stock_entry(production_order_id, purpose, qty=None): production_order = frappe.get_doc("Production Order", production_order_id) - if not frappe.db.get_value("Warehouse", production_order.wip_warehouse, "is_group"): + if not frappe.db.get_value("Warehouse", production_order.wip_warehouse, "is_group") \ + and not production_order.skip_transfer: wip_warehouse = production_order.wip_warehouse else: wip_warehouse = None diff --git a/erpnext/manufacturing/doctype/production_order_item/production_order_item.json b/erpnext/manufacturing/doctype/production_order_item/production_order_item.json index 00e3adf13b..c0b1d009ba 100644 --- a/erpnext/manufacturing/doctype/production_order_item/production_order_item.json +++ b/erpnext/manufacturing/doctype/production_order_item/production_order_item.json @@ -229,6 +229,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "depends_on": "eval:!parent.skip_transfer", "fieldname": "transferred_qty", "fieldtype": "Float", "hidden": 0, @@ -353,7 +354,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2017-07-10 17:37:20.212361", + "modified": "2017-08-18 18:11:10.311736", "modified_by": "Administrator", "module": "Manufacturing", "name": "Production Order Item", diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 7c7e630f01..fbadbc54de 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -556,7 +556,7 @@ class StockEntry(StockController): item_dict = self.get_bom_raw_materials(self.fg_completed_qty) for item in item_dict.values(): - if self.pro_doc: + if self.pro_doc and not self.pro_doc.skip_transfer: item["from_warehouse"] = self.pro_doc.wip_warehouse item["to_warehouse"] = self.to_warehouse if self.purpose=="Subcontract" else ""