Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update workstation hour rate when workstation change in job card #34998

Merged
merged 12 commits into from
May 8, 2023
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