fix: incorrect production item and bom no in job card

This commit is contained in:
Mihir Kandoi
2025-03-17 16:06:54 +05:30
parent 61e126901e
commit d071a6c900
4 changed files with 12 additions and 8 deletions

View File

@@ -86,7 +86,6 @@
"search_index": 1
},
{
"fetch_from": "work_order.bom_no",
"fieldname": "bom_no",
"fieldtype": "Link",
"label": "BOM No",
@@ -281,7 +280,7 @@
"fieldtype": "Column Break"
},
{
"fetch_from": "work_order.production_item",
"fetch_from": "bom_no.item",
"fieldname": "production_item",
"fieldtype": "Link",
"label": "Production Item",
@@ -511,7 +510,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2023-06-28 19:23:14.345214",
"modified": "2025-03-17 15:55:11.143456",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Job Card",

View File

@@ -64,9 +64,7 @@ class JobCard(Document):
from erpnext.manufacturing.doctype.job_card_scheduled_time.job_card_scheduled_time import (
JobCardScheduledTime,
)
from erpnext.manufacturing.doctype.job_card_scrap_item.job_card_scrap_item import (
JobCardScrapItem,
)
from erpnext.manufacturing.doctype.job_card_scrap_item.job_card_scrap_item import JobCardScrapItem
from erpnext.manufacturing.doctype.job_card_time_log.job_card_time_log import JobCardTimeLog
actual_end_date: DF.Datetime | None
@@ -91,7 +89,7 @@ class JobCard(Document):
naming_series: DF.Literal["PO-JOB.#####"]
operation: DF.Link
operation_id: DF.Data | None
operation_row_number: DF.Literal
operation_row_number: DF.Literal[None]
posting_date: DF.Date | None
process_loss_qty: DF.Float
production_item: DF.Link | None

View File

@@ -301,6 +301,12 @@ frappe.ui.form.on("Work Order", {
label: __("Sequence Id"),
read_only: 1,
},
{
fieldtype: "Link",
fieldname: "bom",
label: __("BOM"),
read_only: 1,
},
],
data: operations_data,
in_place_edit: true,
@@ -341,6 +347,7 @@ frappe.ui.form.on("Work Order", {
qty: pending_qty,
pending_qty: pending_qty,
sequence_id: data.sequence_id,
bom: data.bom,
});
}
}

View File

@@ -1616,7 +1616,7 @@ def create_job_card(work_order, row, enable_capacity_planning=False, auto_create
"posting_date": nowdate(),
"for_quantity": row.job_card_qty or work_order.get("qty", 0),
"operation_id": row.get("name"),
"bom_no": work_order.bom_no,
"bom_no": row.get("bom"),
"project": work_order.project,
"company": work_order.company,
"sequence_id": row.get("sequence_id"),