Skip to content

Commit

Permalink
Merge pull request #35311 from CodeVenturers/version-14-hotfix
Browse files Browse the repository at this point in the history
fix: update workstation hour rate when workstation change in job card
  • Loading branch information
rohitwaghchaure authored May 15, 2023
2 parents 5463f0b + bc88415 commit ee147e6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions erpnext/manufacturing/doctype/job_card/job_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ def validate_produced_quantity(self, for_quantity, wo):
)

def update_work_order_data(self, for_quantity, time_in_mins, wo):
workstation_hour_rate = frappe.get_value("Workstation", self.workstation, "hour_rate")
jc = frappe.qb.DocType("Job Card")
jctl = frappe.qb.DocType("Job Card Time Log")

Expand All @@ -587,6 +588,7 @@ def update_work_order_data(self, for_quantity, time_in_mins, wo):
if data.get("workstation") != self.workstation:
# workstations can change in a job card
data.workstation = self.workstation
data.hour_rate = flt(workstation_hour_rate)

wo.flags.ignore_validate_update_after_submit = True
wo.update_operation_status()
Expand Down

0 comments on commit ee147e6

Please sign in to comment.