mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-06 06:58:27 +00:00
fix: now allow to over production against work order
This commit is contained in:
@@ -581,6 +581,8 @@ erpnext.work_order = {
|
|||||||
description: __('Max: {0}', [max]),
|
description: __('Max: {0}', [max]),
|
||||||
default: max
|
default: max
|
||||||
}, data => {
|
}, data => {
|
||||||
|
max += (max * (frm.doc.__onload.overproduction_percentage || 0.0)) / 100;
|
||||||
|
|
||||||
if (data.qty > max) {
|
if (data.qty > max) {
|
||||||
frappe.msgprint(__('Quantity must not be more than {0}', [max]));
|
frappe.msgprint(__('Quantity must not be more than {0}', [max]));
|
||||||
reject();
|
reject();
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class WorkOrder(Document):
|
|||||||
ms = frappe.get_doc("Manufacturing Settings")
|
ms = frappe.get_doc("Manufacturing Settings")
|
||||||
self.set_onload("material_consumption", ms.material_consumption)
|
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("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):
|
def validate(self):
|
||||||
self.validate_production_item()
|
self.validate_production_item()
|
||||||
|
|||||||
Reference in New Issue
Block a user