[minor] add progress bar in patch
This commit is contained in:
parent
00d3cd6d64
commit
c81621d3ce
@ -1,5 +1,6 @@
|
|||||||
import frappe
|
import frappe
|
||||||
from frappe.core.doctype.dynamic_link.dynamic_link import deduplicate_dynamic_links
|
from frappe.core.doctype.dynamic_link.dynamic_link import deduplicate_dynamic_links
|
||||||
|
from frappe.utils import update_progress_bar
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
frappe.reload_doc('core', 'doctype', 'dynamic_link')
|
frappe.reload_doc('core', 'doctype', 'dynamic_link')
|
||||||
@ -13,9 +14,9 @@ def execute():
|
|||||||
)
|
)
|
||||||
for doctype in ('Contact', 'Address'):
|
for doctype in ('Contact', 'Address'):
|
||||||
if frappe.db.has_column(doctype, 'customer'):
|
if frappe.db.has_column(doctype, 'customer'):
|
||||||
for doc in frappe.get_all(doctype, fields='*'):
|
items = frappe.get_all(doctype)
|
||||||
doc.doctype = doctype
|
for i, doc in enumerate(items):
|
||||||
doc = frappe.get_doc(doc)
|
doc = frappe.get_doc(doctype, doc.name)
|
||||||
dirty = False
|
dirty = False
|
||||||
for field in map_fields:
|
for field in map_fields:
|
||||||
if doc.get(field[1]):
|
if doc.get(field[1]):
|
||||||
@ -25,3 +26,6 @@ def execute():
|
|||||||
if dirty:
|
if dirty:
|
||||||
deduplicate_dynamic_links(doc)
|
deduplicate_dynamic_links(doc)
|
||||||
doc.update_children()
|
doc.update_children()
|
||||||
|
|
||||||
|
update_progress_bar('Updating {0}'.format(doctype), i, len(items))
|
||||||
|
print
|
Loading…
x
Reference in New Issue
Block a user