mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-21 22:19:18 +00:00
fix: delete Receive at Warehouse entry on cancellation of Send to Warehouse entry
This commit is contained in:
@@ -117,6 +117,7 @@ class StockEntry(StockController):
|
|||||||
self.update_transferred_qty()
|
self.update_transferred_qty()
|
||||||
self.update_quality_inspection()
|
self.update_quality_inspection()
|
||||||
self.delete_auto_created_batches()
|
self.delete_auto_created_batches()
|
||||||
|
self.delete_linked_stock_entry()
|
||||||
|
|
||||||
def set_job_card_data(self):
|
def set_job_card_data(self):
|
||||||
if self.job_card and not self.work_order:
|
if self.job_card and not self.work_order:
|
||||||
@@ -160,6 +161,12 @@ class StockEntry(StockController):
|
|||||||
frappe.throw(_("For job card {0}, you can only make the 'Material Transfer for Manufacture' type stock entry")
|
frappe.throw(_("For job card {0}, you can only make the 'Material Transfer for Manufacture' type stock entry")
|
||||||
.format(self.job_card))
|
.format(self.job_card))
|
||||||
|
|
||||||
|
def delete_linked_stock_entry(self):
|
||||||
|
if self.purpose == "Send to Warehouse":
|
||||||
|
for d in frappe.get_all("Stock Entry", filters={"docstatus": 0,
|
||||||
|
"outgoing_stock_entry": self.name, "purpose": "Receive at Warehouse"}):
|
||||||
|
frappe.delete_doc("Stock Entry", d.name)
|
||||||
|
|
||||||
def set_transfer_qty(self):
|
def set_transfer_qty(self):
|
||||||
for item in self.get("items"):
|
for item in self.get("items"):
|
||||||
if not flt(item.qty):
|
if not flt(item.qty):
|
||||||
|
|||||||
Reference in New Issue
Block a user