def create_production_order(self, item_dict): #Create production order. Called from Production Planning Tool from erpnext.manufacturing.doctype.work_order.work_order import OverProductionError, get_default_warehouse warehouse = get_default_warehouse() pro = frappe.new_doc("Work Order") pro.update(item_dict) try: pro.insert() return pro.name except OverProductionError: pass
def make_work_order(self): from erpnext.manufacturing.doctype.work_order.work_order import get_default_warehouse wo_list, po_list = [], [] subcontracted_po = {} default_warehouses = get_default_warehouse() self.make_work_order_for_finished_goods(wo_list, default_warehouses) self.make_work_order_for_subassembly_items(wo_list, subcontracted_po, default_warehouses) self.make_subcontracted_purchase_order(subcontracted_po, po_list) self.show_list_created_message("Work Order", wo_list) self.show_list_created_message("Purchase Order", po_list)
def create_work_order(self, item): from erpnext.manufacturing.doctype.work_order.work_order import OverProductionError, get_default_warehouse warehouse = get_default_warehouse() wo = frappe.new_doc("Work Order") wo.update(item) wo.set_work_order_operations() if not wo.fg_warehouse: wo.fg_warehouse = warehouse.get('fg_warehouse') try: wo.insert() return wo.name except OverProductionError: pass
def create_work_order(self, item_dict): """Create work order. Called from Production Planning Tool""" from erpnext.manufacturing.doctype.work_order.work_order import OverProductionError, get_default_warehouse warehouse = get_default_warehouse() wo = frappe.new_doc("Work Order") wo.update(item_dict) wo.set_work_order_operations() if warehouse: wo.wip_warehouse = warehouse.get('wip_warehouse') if not wo.fg_warehouse: wo.fg_warehouse = warehouse.get('fg_warehouse') try: wo.insert() return wo.name except OverProductionError: pass
def create_work_order(self, item): from erpnext.manufacturing.doctype.work_order.work_order import ( OverProductionError, get_default_warehouse, ) warehouse = get_default_warehouse() wo = frappe.new_doc("Work Order") wo.update(item) wo.planned_start_date = item.get('planned_start_date') or item.get( 'schedule_date') if item.get("warehouse"): wo.fg_warehouse = item.get("warehouse") wo.set_work_order_operations() if not wo.fg_warehouse: wo.fg_warehouse = warehouse.get('fg_warehouse') try: wo.flags.ignore_mandatory = True wo.insert() return wo.name except OverProductionError: pass