feat: provision to have limited parameters for in-process quality inspection
This commit is contained in:
@@ -70,6 +70,23 @@ frappe.ui.form.on('Job Card', {
|
|||||||
&& (frm.doc.items || !frm.doc.items.length || frm.doc.for_quantity == frm.doc.transferred_qty)) {
|
&& (frm.doc.items || !frm.doc.items.length || frm.doc.for_quantity == frm.doc.transferred_qty)) {
|
||||||
frm.trigger("prepare_timer_buttons");
|
frm.trigger("prepare_timer_buttons");
|
||||||
}
|
}
|
||||||
|
frm.trigger("setup_quality_inspection");
|
||||||
|
},
|
||||||
|
|
||||||
|
setup_quality_inspection: function(frm) {
|
||||||
|
let quality_inspection_field = frm.get_docfield("quality_inspection");
|
||||||
|
quality_inspection_field.get_route_options_for_new_doc = function(frm) {
|
||||||
|
return {
|
||||||
|
"inspection_type": "In Process",
|
||||||
|
"reference_type": "Job Card",
|
||||||
|
"reference_name": frm.doc.name,
|
||||||
|
"item_code": frm.doc.production_item,
|
||||||
|
"item_name": frm.doc.item_name,
|
||||||
|
"item_serial_no": frm.doc.serial_no,
|
||||||
|
"batch_no": frm.doc.batch_no,
|
||||||
|
"quality_inspection_template": frm.doc.quality_inspection_template,
|
||||||
|
};
|
||||||
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
setup_corrective_job_card: function(frm) {
|
setup_corrective_job_card: function(frm) {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
"serial_no",
|
"serial_no",
|
||||||
"column_break_12",
|
"column_break_12",
|
||||||
"wip_warehouse",
|
"wip_warehouse",
|
||||||
|
"quality_inspection_template",
|
||||||
"quality_inspection",
|
"quality_inspection",
|
||||||
"project",
|
"project",
|
||||||
"batch_no",
|
"batch_no",
|
||||||
@@ -407,11 +408,17 @@
|
|||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"options": "Job Card Scrap Item",
|
"options": "Job Card Scrap Item",
|
||||||
"print_hide": 1
|
"print_hide": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "quality_inspection_template",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Quality Inspection Template",
|
||||||
|
"options": "Quality Inspection Template"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-09-14 00:38:46.873105",
|
"modified": "2021-11-03 13:46:06.557348",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Manufacturing",
|
"module": "Manufacturing",
|
||||||
"name": "Job Card",
|
"name": "Job Card",
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ class JobCard(Document):
|
|||||||
self.validate_sequence_id()
|
self.validate_sequence_id()
|
||||||
self.set_sub_operations()
|
self.set_sub_operations()
|
||||||
self.update_sub_operation_status()
|
self.update_sub_operation_status()
|
||||||
|
self.set_quality_inspection_template()
|
||||||
|
|
||||||
def set_sub_operations(self):
|
def set_sub_operations(self):
|
||||||
if self.operation:
|
if self.operation:
|
||||||
@@ -292,6 +293,10 @@ class JobCard(Document):
|
|||||||
row.completed_time = 0.0
|
row.completed_time = 0.0
|
||||||
row.completed_qty = 0.0
|
row.completed_qty = 0.0
|
||||||
|
|
||||||
|
def set_quality_inspection_template(self):
|
||||||
|
qi_template = frappe.db.get_value('Operation', self.operation, 'quality_inspection_template')
|
||||||
|
self.quality_inspection_template = qi_template
|
||||||
|
|
||||||
def update_time_logs(self, row):
|
def update_time_logs(self, row):
|
||||||
self.append("time_logs", {
|
self.append("time_logs", {
|
||||||
"from_time": row.planned_start_time,
|
"from_time": row.planned_start_time,
|
||||||
|
|||||||
@@ -9,11 +9,11 @@
|
|||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
"field_order": [
|
"field_order": [
|
||||||
"workstation",
|
"workstation",
|
||||||
"quality_inspection_template",
|
|
||||||
"data_2",
|
"data_2",
|
||||||
"is_corrective_operation",
|
"is_corrective_operation",
|
||||||
"job_card_section",
|
"job_card_section",
|
||||||
"create_job_card_based_on_batch_size",
|
"create_job_card_based_on_batch_size",
|
||||||
|
"quality_inspection_template",
|
||||||
"column_break_6",
|
"column_break_6",
|
||||||
"batch_size",
|
"batch_size",
|
||||||
"sub_operations_section",
|
"sub_operations_section",
|
||||||
@@ -104,7 +104,7 @@
|
|||||||
"icon": "fa fa-wrench",
|
"icon": "fa fa-wrench",
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-11-01 15:13:35.911144",
|
"modified": "2021-11-03 13:49:39.114976",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Manufacturing",
|
"module": "Manufacturing",
|
||||||
"name": "Operation",
|
"name": "Operation",
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ frappe.ui.form.on("Quality Inspection", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
item_code: function(frm) {
|
item_code: function(frm) {
|
||||||
if (frm.doc.item_code) {
|
if (frm.doc.item_code && !frm.doc.quality_inspection_template) {
|
||||||
return frm.call({
|
return frm.call({
|
||||||
method: "get_quality_inspection_template",
|
method: "get_quality_inspection_template",
|
||||||
doc: frm.doc,
|
doc: frm.doc,
|
||||||
|
|||||||
@@ -19,6 +19,15 @@ class QualityInspection(Document):
|
|||||||
if not self.readings and self.item_code:
|
if not self.readings and self.item_code:
|
||||||
self.get_item_specification_details()
|
self.get_item_specification_details()
|
||||||
|
|
||||||
|
if self.inspection_type=="In Process" and self.reference_type=="Job Card":
|
||||||
|
item_qi_template = frappe.db.get_value("Item", self.item_code, 'quality_inspection_template')
|
||||||
|
parameters = get_template_details(item_qi_template)
|
||||||
|
for reading in self.readings:
|
||||||
|
for d in parameters:
|
||||||
|
if reading.specification == d.specification:
|
||||||
|
reading.update(d)
|
||||||
|
reading.status = "Accepted"
|
||||||
|
|
||||||
if self.readings:
|
if self.readings:
|
||||||
self.inspect_and_set_status()
|
self.inspect_and_set_status()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user