Sfoglia il codice sorgente

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

* [hotfix] delete and sync the child table customization

* Update utils.py
version-14
Makarand Bauskar 7 anni fa
committed by Rushabh Mehta
parent
commit
39d831bc23
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. +3
    -2
      frappe/modules/utils.py

+ 3
- 2
frappe/modules/utils.py Vedi File

@@ -100,8 +100,9 @@ def sync_customizations_for_doctype(data):
update_schema = False

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]:
d['doctype'] = custom_doctype


Caricamento…
Annulla
Salva