Merge pull request #19962 from rohitwaghchaure/allow_overproduction_against_work_order

fix: now allow to over production against work order
This commit is contained in:
rohitwaghchaure 2019-12-17 17:16:24 +05:30 committed by GitHub
commit 3772b2e03e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -605,6 +605,8 @@ erpnext.work_order = {
description: __('Max: {0}', [max]),
default: max
}, data => {
max += (max * (frm.doc.__onload.overproduction_percentage || 0.0)) / 100;
if (data.qty > max) {
frappe.msgprint(__('Quantity must not be more than {0}', [max]));
reject();

View File

@ -38,7 +38,7 @@ class WorkOrder(Document):
ms = frappe.get_doc("Manufacturing Settings")
self.set_onload("material_consumption", ms.material_consumption)
self.set_onload("backflush_raw_materials_based_on", ms.backflush_raw_materials_based_on)
self.set_onload("overproduction_percentage", ms.overproduction_percentage_for_work_order)
def validate(self):
self.validate_production_item()