mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 15:09:20 +00:00
Over Production Allowance Percentage Setting added to Manufacturing Settings
This commit is contained in:
@@ -55,6 +55,13 @@
|
|||||||
"label": "Time Between Operations (in mins)",
|
"label": "Time Between Operations (in mins)",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": ""
|
"precision": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "over_production_allowance_percentage",
|
||||||
|
"fieldtype": "Percent",
|
||||||
|
"label": "Over Production Allowance Percentage",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": ""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"hide_heading": 0,
|
"hide_heading": 0,
|
||||||
@@ -65,7 +72,7 @@
|
|||||||
"is_submittable": 0,
|
"is_submittable": 0,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"modified": "2015-04-21 07:57:40.260862",
|
"modified": "2015-06-15 05:52:22.986958",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Manufacturing",
|
"module": "Manufacturing",
|
||||||
"name": "Manufacturing Settings",
|
"name": "Manufacturing Settings",
|
||||||
|
|||||||
@@ -91,7 +91,8 @@ class ProductionOrder(Document):
|
|||||||
# total qty in SO
|
# total qty in SO
|
||||||
so_qty = flt(so_item_qty) + flt(dnpi_qty)
|
so_qty = flt(so_item_qty) + flt(dnpi_qty)
|
||||||
|
|
||||||
if total_qty > so_qty:
|
allowance_percentage = flt(frappe.db.get_single_value("Manufacturing Settings", "over_production_allowance_percentage"))
|
||||||
|
if total_qty > so_qty + (allowance_percentage/100 * so_qty):
|
||||||
frappe.throw(_("Cannot produce more Item {0} than Sales Order quantity {1}").format(self.production_item,
|
frappe.throw(_("Cannot produce more Item {0} than Sales Order quantity {1}").format(self.production_item,
|
||||||
so_qty), OverProductionError)
|
so_qty), OverProductionError)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user