Production Plan extension

This commit is contained in:
2024-08-08 10:37:37 +00:00
parent 43d9b0dc0f
commit cd98dffbab
2 changed files with 84 additions and 76 deletions

View File

@@ -104,6 +104,12 @@ app_include_js = "manufacturing_overview.bundle.js"
# } # }
# } # }
# doc_events = {
# "Subcontracting Receipt": {
# "on_submit": "manufacturing_overview.manufacturing_overview.productionplan.update_productionplan_status",
# }
# }
# Scheduled Tasks # Scheduled Tasks
# --------------- # ---------------

View File

@@ -79,29 +79,31 @@ def fixfinisheditemwopo(production_plan):
for row in pp.po_items: for row in pp.po_items:
po_data = { po_data = {
"fg_item": row.item_code, "fg_item": row.item_code,
# "warehouse": row.fg_warehouse, "warehouse": row.warehouse,
# "production_plan_sub_assembly_item": row.name, "bom": row.bom_no,
# "bom": row.bom_no, "production_plan": pp.name,
# "production_plan": pp.name, "fg_item_qty": row.planned_qty,
# "fg_item_qty": row.qty, "supplier_warehouse": "Externe Arbeiten - HP"
} }
# for field in [ for field in [
# "schedule_date", "schedule_date",
# "qty", "qty",
# "description", "description",
# "production_plan_item", "production_plan_item",
# ]: ]:
# po_data[field] = row.get(field) po_data[field] = row.get(field)
po.append("items", po_data) po.append("items", po_data)
po.set_service_items_for_finished_goods() po.set_service_items_for_finished_goods()
po.set_missing_values() po.set_missing_values()
po.flags.ignore_mandatory = True # po.flags.ignore_mandatory = True
po.flags.ignore_validate = True # po.flags.ignore_validate = True
po.insert() po.insert()
# pp.db_set("total_produced_qty", pp.total_planned_qty)
# pp.db_set("status", "Completed")
return {'status': 201, return {'status': 201,
'docname': po.name} 'docname': po.name}