mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-14 12:38:46 +00:00
fix: exclude current doc when checking for duplicate
(cherry picked from commit d8ef5e4d58)
This commit is contained in:
@@ -42,6 +42,7 @@ class TestWorkOrder(FrappeTestCase):
|
|||||||
prepare_data_for_backflush_based_on_materials_transferred()
|
prepare_data_for_backflush_based_on_materials_transferred()
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
|
frappe.local.future_sle = {}
|
||||||
frappe.db.rollback()
|
frappe.db.rollback()
|
||||||
|
|
||||||
def check_planned_qty(self):
|
def check_planned_qty(self):
|
||||||
|
|||||||
@@ -913,7 +913,12 @@ class StockEntry(StockController):
|
|||||||
|
|
||||||
if frappe.db.exists(
|
if frappe.db.exists(
|
||||||
"Stock Entry",
|
"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(
|
frappe.throw(
|
||||||
_("Only one {0} entry can be created against the Work Order {1}").format(
|
_("Only one {0} entry can be created against the Work Order {1}").format(
|
||||||
|
|||||||
Reference in New Issue
Block a user