fix: Add links in validation message
This commit is contained in:
parent
2b969a469a
commit
23c80658ba
@ -324,8 +324,10 @@ class StockEntry(StockController):
|
|||||||
completed_qty = d.completed_qty + (allowance_percentage/100 * d.completed_qty)
|
completed_qty = d.completed_qty + (allowance_percentage/100 * d.completed_qty)
|
||||||
if total_completed_qty > flt(completed_qty):
|
if total_completed_qty > flt(completed_qty):
|
||||||
job_card = frappe.db.get_value('Job Card', {'operation_id': d.name}, 'name')
|
job_card = frappe.db.get_value('Job Card', {'operation_id': d.name}, 'name')
|
||||||
frappe.throw(_("Row #{0}: Operation {1} is not completed for {2} qty of finished goods in Work Order # {3}. Please update operation status via Job Card # {4}")
|
work_order_link = frappe.utils.get_link_to_form('Work Order', self.work_order)
|
||||||
.format(d.idx, d.operation, total_completed_qty, self.work_order, job_card), OperationsNotCompleteError)
|
job_card_link = frappe.utils.get_link_to_form('Job Card', job_card)
|
||||||
|
frappe.throw(_("Row #{0}: Operation {1} is not completed for {2} qty of finished goods in Work Order {3}. Please update operation status via Job Card {4}.")
|
||||||
|
.format(d.idx, frappe.bold(d.operation), frappe.bold(total_completed_qty), work_order_link, job_card_link), OperationsNotCompleteError)
|
||||||
|
|
||||||
def check_duplicate_entry_for_work_order(self):
|
def check_duplicate_entry_for_work_order(self):
|
||||||
other_ste = [t[0] for t in frappe.db.get_values("Stock Entry", {
|
other_ste = [t[0] for t in frappe.db.get_values("Stock Entry", {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user