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

This commit is contained in:
vishnu
2023-05-15 14:50:40 +00:00
parent 5463f0b137
commit bc88415e73

View File

@@ -562,6 +562,7 @@ class JobCard(Document):
)
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")
@@ -587,6 +588,7 @@ class JobCard(Document):
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()