delete boms only when found
This commit is contained in:
parent
6c3082591c
commit
c9172e0079
@ -283,10 +283,11 @@ class Company(Document):
|
|||||||
|
|
||||||
# delete BOMs
|
# delete BOMs
|
||||||
boms = frappe.db.sql_list("select name from tabBOM where company=%s", self.name)
|
boms = frappe.db.sql_list("select name from tabBOM where company=%s", self.name)
|
||||||
frappe.db.sql("delete from tabBOM where company=%s", self.name)
|
if boms:
|
||||||
for dt in ("BOM Operation", "BOM Item", "BOM Scrap Item", "BOM Explosion Item"):
|
frappe.db.sql("delete from tabBOM where company=%s", self.name)
|
||||||
frappe.db.sql("delete from `tab%s` where parent in (%s)"""
|
for dt in ("BOM Operation", "BOM Item", "BOM Scrap Item", "BOM Explosion Item"):
|
||||||
% (dt, ', '.join(['%s']*len(boms))), tuple(boms))
|
frappe.db.sql("delete from `tab%s` where parent in (%s)"""
|
||||||
|
% (dt, ', '.join(['%s']*len(boms))), tuple(boms), debug=1)
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def enqueue_replace_abbr(company, old, new):
|
def enqueue_replace_abbr(company, old, new):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user