From bb9713a7b24d8828407a0c1ac1007d196be50c64 Mon Sep 17 00:00:00 2001 From: Diksha Jadhav Date: Tue, 9 Nov 2021 14:21:34 +0530 Subject: [PATCH] refactor: use fetch from property for qi template on job card (cherry picked from commit 467324c87f407f66b20d8182039fa902b6ffc82f) --- erpnext/manufacturing/doctype/job_card/job_card.json | 3 ++- erpnext/manufacturing/doctype/job_card/job_card.py | 5 ----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/erpnext/manufacturing/doctype/job_card/job_card.json b/erpnext/manufacturing/doctype/job_card/job_card.json index 0682144e4a0..8095e66eac0 100644 --- a/erpnext/manufacturing/doctype/job_card/job_card.json +++ b/erpnext/manufacturing/doctype/job_card/job_card.json @@ -410,6 +410,7 @@ "print_hide": 1 }, { + "fetch_from": "operation.quality_inspection_template", "fieldname": "quality_inspection_template", "fieldtype": "Link", "label": "Quality Inspection Template", @@ -418,7 +419,7 @@ ], "is_submittable": 1, "links": [], - "modified": "2021-11-03 13:46:06.557348", + "modified": "2021-11-09 14:07:20.290306", "modified_by": "Administrator", "module": "Manufacturing", "name": "Job Card", diff --git a/erpnext/manufacturing/doctype/job_card/job_card.py b/erpnext/manufacturing/doctype/job_card/job_card.py index 22e8b54eb91..e1d79be81c4 100644 --- a/erpnext/manufacturing/doctype/job_card/job_card.py +++ b/erpnext/manufacturing/doctype/job_card/job_card.py @@ -45,7 +45,6 @@ class JobCard(Document): self.validate_sequence_id() self.set_sub_operations() self.update_sub_operation_status() - self.set_quality_inspection_template() def set_sub_operations(self): if self.operation: @@ -293,10 +292,6 @@ class JobCard(Document): row.completed_time = 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): self.append("time_logs", { "from_time": row.planned_start_time,