mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-22 19:55:29 +00:00
fix: subcontracting receipt -> alllow to change Batch / Serial Nos (v14) (#40371)
fix: subcontracting receipt -> alllow to change Batch / Serial Nos
This commit is contained in:
@@ -74,8 +74,9 @@ class SubcontractingReceipt(SubcontractingController):
|
|||||||
if (
|
if (
|
||||||
frappe.db.get_single_value("Buying Settings", "backflush_raw_materials_of_subcontract_based_on")
|
frappe.db.get_single_value("Buying Settings", "backflush_raw_materials_of_subcontract_based_on")
|
||||||
== "BOM"
|
== "BOM"
|
||||||
):
|
) and not self.has_serial_batch_items():
|
||||||
self.supplied_items = []
|
self.supplied_items = []
|
||||||
|
|
||||||
super(SubcontractingReceipt, self).validate()
|
super(SubcontractingReceipt, self).validate()
|
||||||
self.set_missing_values()
|
self.set_missing_values()
|
||||||
self.validate_posting_time()
|
self.validate_posting_time()
|
||||||
@@ -125,6 +126,14 @@ class SubcontractingReceipt(SubcontractingController):
|
|||||||
self.calculate_supplied_items_qty_and_amount()
|
self.calculate_supplied_items_qty_and_amount()
|
||||||
self.calculate_items_qty_and_amount()
|
self.calculate_items_qty_and_amount()
|
||||||
|
|
||||||
|
def has_serial_batch_items(self):
|
||||||
|
if not self.get("supplied_items"):
|
||||||
|
return False
|
||||||
|
|
||||||
|
for row in self.get("supplied_items"):
|
||||||
|
if row.serial_no or row.batch_no:
|
||||||
|
return True
|
||||||
|
|
||||||
def set_available_qty_for_consumption(self):
|
def set_available_qty_for_consumption(self):
|
||||||
supplied_items_details = {}
|
supplied_items_details = {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user