mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 11:49:10 +00:00
Validate Completed Qty and Produced qty in Stock Entry for Manufacture (#15248)
This commit is contained in:
committed by
Nabin Hait
parent
9983d41fb0
commit
0cd5313c69
@@ -58,6 +58,7 @@ class StockEntry(StockController):
|
|||||||
self.validate_with_material_request()
|
self.validate_with_material_request()
|
||||||
self.validate_batch()
|
self.validate_batch()
|
||||||
self.validate_inspection()
|
self.validate_inspection()
|
||||||
|
self.validate_fg_completed_qty()
|
||||||
|
|
||||||
if not self.from_bom:
|
if not self.from_bom:
|
||||||
self.fg_completed_qty = 0.0
|
self.fg_completed_qty = 0.0
|
||||||
@@ -186,6 +187,13 @@ class StockEntry(StockController):
|
|||||||
if stock_qty > trans_qty:
|
if stock_qty > trans_qty:
|
||||||
item_code.append(item.item_code)
|
item_code.append(item.item_code)
|
||||||
|
|
||||||
|
def validate_fg_completed_qty(self):
|
||||||
|
if self.purpose == "Manufacture" and self.work_order:
|
||||||
|
production_item = frappe.get_value('Work Order', self.work_order, 'production_item')
|
||||||
|
for item in self.items:
|
||||||
|
if item.item_code == production_item and item.qty != self.fg_completed_qty:
|
||||||
|
frappe.throw(_("Finished product quantity <b>{0}</b> and For Quantity <b>{1}</b> cannot be different").format(item.qty, self.fg_completed_qty))
|
||||||
|
|
||||||
def validate_warehouse(self):
|
def validate_warehouse(self):
|
||||||
"""perform various (sometimes conditional) validations on warehouse"""
|
"""perform various (sometimes conditional) validations on warehouse"""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user