Merge pull request #34998 from Vishnu7025/develop

fix: update workstation hour rate when workstation change in job card
This commit is contained in:
rohitwaghchaure 2023-05-08 09:25:38 +05:30 committed by GitHub
commit ecc80a8504
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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()