Merge pull request #19248 from rohitwaghchaure/not_able_to_submit_work_order_v12

fix: not able to submit the work order
This commit is contained in:
rohitwaghchaure 2019-10-05 23:29:44 +05:30 committed by GitHub
commit 16b8e7c432
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -328,6 +328,10 @@ class StockEntry(StockController):
completed_qty = d.completed_qty + (allowance_percentage/100 * d.completed_qty)
if total_completed_qty > flt(completed_qty):
job_card = frappe.db.get_value('Job Card', {'operation_id': d.name}, 'name')
if not job_card:
frappe.throw(_("Work Order {0}: job card not found for the operation {1}")
.format(self.work_order, job_card))
work_order_link = frappe.utils.get_link_to_form('Work Order', self.work_order)
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}.")