Merge pull request #46534 from frappe/mergify/bp/version-15-hotfix/pr-46533

fix: exclude current doc when checking for duplicate (backport #46533)
This commit is contained in:
Sagar Vora
2025-03-15 00:37:55 +05:30
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@@ -42,6 +42,7 @@ class TestWorkOrder(FrappeTestCase):
prepare_data_for_backflush_based_on_materials_transferred()
def tearDown(self):
frappe.local.future_sle = {}
frappe.db.rollback()
def check_planned_qty(self):

View File

@@ -913,7 +913,12 @@ class StockEntry(StockController):
if frappe.db.exists(
"Stock Entry",
{"docstatus": 1, "work_order": self.work_order, "purpose": "Manufacture"},
{
"docstatus": 1,
"work_order": self.work_order,
"purpose": "Manufacture",
"name": ("!=", self.name),
},
):
frappe.throw(
_("Only one {0} entry can be created against the Work Order {1}").format(