diff --git a/erpnext/manufacturing/doctype/routing/test_routing.py b/erpnext/manufacturing/doctype/routing/test_routing.py index 4575c1d1d57..1cec3b657b4 100644 --- a/erpnext/manufacturing/doctype/routing/test_routing.py +++ b/erpnext/manufacturing/doctype/routing/test_routing.py @@ -102,9 +102,11 @@ def create_routing(**args): doc.update(args) if not args.do_not_save: + frappe.db.savepoint("create_routing") try: doc.insert() except frappe.DuplicateEntryError: + frappe.db.rollback(save_point="create_routing") doc = frappe.get_doc("Routing", args.routing_name) doc.delete_key("operations") for operation in args.operations: