diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js index d57f639f7f..e2192157c8 100644 --- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js +++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js @@ -31,6 +31,16 @@ cur_frm.cscript.download_materials_required = function(doc, cdt, cdn) { }); } + +cur_frm.fields_dict['pp_so_details'].grid.get_field('sales_order').get_query = function(doc) { + var args = { "docstatus": 1 }; + if(doc.customer) { + args["customer"] = doc.customer; + } + + return { filters: args } +} + cur_frm.fields_dict['pp_details'].grid.get_field('item_code').get_query = function(doc) { return erpnext.queries.item({ 'is_pro_applicable': 'Yes' diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py index a15e3649a1..945c77e535 100644 --- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py @@ -276,7 +276,7 @@ class ProductionPlanningTool(Document): item_list.append([item, flt(item_details.qty) * so_qty[1], item_details.description, item_details.stock_uom, item_details.min_order_qty, so_qty[0]]) - self.make_items_dict(item_list) + self.make_items_dict(item_list) def make_items_dict(self, item_list): for i in item_list: