fix: use serial/batch fields for subcontracting receipt and in transit stock entry

This commit is contained in:
Rohit Waghchaure
2024-03-21 20:28:16 +05:30
parent 6d603cc35f
commit 3423334e4f
8 changed files with 388 additions and 21 deletions

View File

@@ -380,6 +380,12 @@ class AccountsController(TransactionBase):
for bundle in bundles:
frappe.delete_doc("Serial and Batch Bundle", bundle.name)
batches = frappe.get_all(
"Batch", filters={"reference_doctype": self.doctype, "reference_name": self.name}
)
for row in batches:
frappe.delete_doc("Batch", row.name)
def validate_return_against_account(self):
if (
self.doctype in ["Sales Invoice", "Purchase Invoice"] and self.is_return and self.return_against