Skip to content

Commit

Permalink
refactor: use fetch from property for qi template on job card
Browse files Browse the repository at this point in the history
  • Loading branch information
DeeMysterio committed Nov 9, 2021
1 parent 6c45f8b commit 467324c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 2 additions & 1 deletion erpnext/manufacturing/doctype/job_card/job_card.json
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@
"print_hide": 1
},
{
"fetch_from": "operation.quality_inspection_template",
"fieldname": "quality_inspection_template",
"fieldtype": "Link",
"label": "Quality Inspection Template",
Expand All @@ -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",
Expand Down
5 changes: 0 additions & 5 deletions erpnext/manufacturing/doctype/job_card/job_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def validate(self):
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:
Expand Down Expand Up @@ -293,10 +292,6 @@ def update_sub_operation_status(self):
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,
Expand Down

0 comments on commit 467324c

Please sign in to comment.