Merge pull request #50906 from mihir-kandoi/gh39459

This commit is contained in:
Mihir Kandoi
2025-12-03 18:09:37 +05:30
committed by GitHub

View File

@@ -220,17 +220,12 @@ class JobCard(Document):
if job_card_qty and ((job_card_qty - completed_qty) > wo_qty): if job_card_qty and ((job_card_qty - completed_qty) > wo_qty):
form_link = get_link_to_form("Manufacturing Settings", "Manufacturing Settings") form_link = get_link_to_form("Manufacturing Settings", "Manufacturing Settings")
frappe.throw(
msg = f""" _(
Qty To Manufacture in the job card "Qty To Manufacture in the job card cannot be greater than Qty To Manufacture in the work order for the operation {0}. <br><br><b>Solution: </b> Either you can reduce the Qty To Manufacture in the job card or set the 'Overproduction Percentage For Work Order' in the {1}."
cannot be greater than Qty To Manufacture in the ).format(bold(self.operation), form_link),
work order for the operation {bold(self.operation)}. title=_("Extra Job Card Quantity"),
<br><br><b>Solution: </b> Either you can reduce the )
Qty To Manufacture in the job card or set the
'Overproduction Percentage For Work Order'
in the {form_link}."""
frappe.throw(_(msg), title=_("Extra Job Card Quantity"))
def set_sub_operations(self): def set_sub_operations(self):
if not self.sub_operations and self.operation: if not self.sub_operations and self.operation:
@@ -1170,14 +1165,16 @@ class JobCard(Document):
) )
if row.completed_qty < current_operation_qty: if row.completed_qty < current_operation_qty:
msg = f"""The completed quantity {bold(current_operation_qty)} frappe.throw(
of an operation {bold(self.operation)} cannot be greater _(
than the completed quantity {bold(row.completed_qty)} "The completed quantity {0} of an operation {1} cannot be greater than the completed quantity {2} of a previous operation {3}."
of a previous operation ).format(
{bold(row.operation)}. bold(current_operation_qty),
""" bold(self.operation),
bold(row.completed_qty),
frappe.throw(_(msg)) bold(row.operation),
)
)
def validate_work_order(self): def validate_work_order(self):
if self.is_work_order_closed(): if self.is_work_order_closed():