fix: Delete orphaned asset movement item records

This commit is contained in:
Nabin Hait
2024-02-20 12:11:12 +05:30
parent 11bddc14bb
commit 46cd929d00
2 changed files with 8 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
import frappe
def execute():
frappe.db.sql("""
DELETE FROM `tabAsset Movement Item`
WHERE parent NOT IN (SELECT name FROM `tabAsset Movement`)
""")