|
@@ -100,8 +100,9 @@ def sync_customizations_for_doctype(data): |
|
|
update_schema = False |
|
|
update_schema = False |
|
|
|
|
|
|
|
|
def sync(key, custom_doctype, doctype_fieldname): |
|
|
def sync(key, custom_doctype, doctype_fieldname): |
|
|
frappe.db.sql('delete from `tab{0}` where `{1}`=%s'.format(custom_doctype, doctype_fieldname), |
|
|
|
|
|
doctype) |
|
|
|
|
|
|
|
|
doctypes = list(set(map(lambda row: row.get(doctype_fieldname), data[key]))) |
|
|
|
|
|
frappe.db.sql('delete from `tab{0}` where `{1}` in ({2})'.format( |
|
|
|
|
|
custom_doctype, doctype_fieldname, ",".join(["'%s'" % dt for dt in doctypes]))) |
|
|
|
|
|
|
|
|
for d in data[key]: |
|
|
for d in data[key]: |
|
|
d['doctype'] = custom_doctype |
|
|
d['doctype'] = custom_doctype |
|
|