Production Plan extension
This commit is contained in:
@@ -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
|
||||
# ---------------
|
||||
|
||||
|
||||
@@ -79,29 +79,31 @@ def fixfinisheditemwopo(production_plan):
|
||||
for row in pp.po_items:
|
||||
po_data = {
|
||||
"fg_item": row.item_code,
|
||||
# "warehouse": row.fg_warehouse,
|
||||
# "production_plan_sub_assembly_item": row.name,
|
||||
# "bom": row.bom_no,
|
||||
# "production_plan": pp.name,
|
||||
# "fg_item_qty": row.qty,
|
||||
"warehouse": row.warehouse,
|
||||
"bom": row.bom_no,
|
||||
"production_plan": pp.name,
|
||||
"fg_item_qty": row.planned_qty,
|
||||
"supplier_warehouse": "Externe Arbeiten - HP"
|
||||
}
|
||||
|
||||
# for field in [
|
||||
# "schedule_date",
|
||||
# "qty",
|
||||
# "description",
|
||||
# "production_plan_item",
|
||||
# ]:
|
||||
# po_data[field] = row.get(field)
|
||||
for field in [
|
||||
"schedule_date",
|
||||
"qty",
|
||||
"description",
|
||||
"production_plan_item",
|
||||
]:
|
||||
po_data[field] = row.get(field)
|
||||
|
||||
po.append("items", po_data)
|
||||
|
||||
po.set_service_items_for_finished_goods()
|
||||
po.set_missing_values()
|
||||
po.flags.ignore_mandatory = True
|
||||
po.flags.ignore_validate = True
|
||||
# po.flags.ignore_mandatory = True
|
||||
# po.flags.ignore_validate = True
|
||||
po.insert()
|
||||
|
||||
# pp.db_set("total_produced_qty", pp.total_planned_qty)
|
||||
# pp.db_set("status", "Completed")
|
||||
|
||||
return {'status': 201,
|
||||
'docname': po.name}
|
||||
Reference in New Issue
Block a user