Parcourir la source

[hotfix] delete and sync the child table customization (#4371)

* [hotfix] delete and sync the child table customization

* Update utils.py
version-14
Makarand Bauskar il y a 7 ans
committed by Rushabh Mehta
Parent
révision
39d831bc23
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. +3
    -2
      frappe/modules/utils.py

+ 3
- 2
frappe/modules/utils.py Voir le fichier

@@ -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


Chargement…
Annuler
Enregistrer