Can anyone help on where / how to upload routings using Import Function? I don’t see the table in the import list to update. I have 1000+ routings to upload. Thanks in advance!
curl -s -L -X POST "https://erp.erpnext.host/api/resource/Workstation" \
-H "Authorization: token c6fbad0badb176b:37dead0deada27a" \
-H "Content-Type: application/json" \
--data-raw "{
\"workstation_name\": \"Chem Demo Clean Room\",
\"production_capacity\": 30,
\"hour_rate_electricity\": 0.25,
\"hour_rate_consumable\": 1.0,
\"hour_rate_rent\": 1.75,
\"hour_rate_labour\": 5.0
}"
curl -s -L -X POST "https://erp.erpnext.host/api/resource/Operation" \
-H "Authorization: token c6fbad0badb176b:37dead0deada27a" \
-H "Content-Type: application/json" \
--data-raw "{
\"name\": \"Chem Demo Filling\",
\"workstation\": \"Chem Demo Clean Room\"
}"
curl -s -L -X POST "https://erp.erpnext.host/api/resource/Routing" \
-H "Authorization: token c6fbad0badb176b:37dead0deada27a" \
-H "Content-Type: application/json" \
--data-raw "{
\"routing_name\": \"Chem Demo Filling Route\",
\"operations\": [
{
\"operation\": \"Chem Demo Filling\",
\"time_in_mins\": 12,
\"workstation\": \"Chem Demo Clean Room\"
}
]
}"
Thankyou Martin I will give it a try!
Martin, I am getting “Insufficient Permission for Routing”, I am using an Admin with role and modules selected for manufacturing. Any ideas what I have wrong?
Martin, think I resolved. Had to have Token:Secret. Thanks
Martin, how would one add in more than one ID_Sequence (more than one operation on routing)? I’ve created the below, but it only populates the last ID_Sequence
{
“routing_name”: “TEST1”,
“operations”: [
{
“operation”: “TURNING”,
“time_in_mins”: 12,
“workstation”: “BENCH”,
“operating_cost”: “2.00”,
“base_hour_rate”: “50”,
“base_operating_cost”: “1.50”,
“hour_rate”: “50.00”,
“sequence_id”: “10”,
“operation”: “MILLING”,
“time_in_mins”: 8,
“workstation”: “MAKINO CELL”,
“operating_cost”: “5.00”,
“base_hour_rate”: “100”,
“base_operating_cost”: “10.50”,
“hour_rate”: “500.00”,
“sequence_id”: “20”
}
]
}
RESULTS IN:
{
“data”: {
“name”: “TEST1”,
“owner”: “Administrator”,
“creation”: “2021-05-16 18:08:23.169436”,
“modified”: “2021-05-16 18:08:23.169436”,
“modified_by”: “Administrator”,
“parent”: null,
“parentfield”: null,
“parenttype”: null,
“idx”: 0,
“docstatus”: 0,
“routing_name”: “TEST1”,
“disabled”: 0,
“doctype”: “Routing”,
“operations”: [
{
“name”: “b155450a63”,
“owner”: “Administrator”,
“creation”: “2021-05-16 18:08:23.169436”,
“modified”: “2021-05-16 18:08:23.169436”,
“modified_by”: “Administrator”,
“parent”: “TEST1”,
“parentfield”: “operations”,
“parenttype”: “Routing”,
“idx”: 1,
“docstatus”: 0,
“sequence_id”: 20,
“operation”: “MILLING”,
“workstation”: “MAKINO CELL”,
“description”: null,
“hour_rate”: 500.0,
“time_in_mins”: 8.0,
“batch_size”: 1,
“operating_cost”: 5.0,
“base_hour_rate”: 100.0,
“base_operating_cost”: 10.5,
“image”: null,
“doctype”: “BOM Operation”,
“__unsaved”: 1
}
]
}
}