diff --git a/erpnext/patches/remove_previous_field_property_setter.py b/erpnext/patches/remove_previous_field_property_setter.py new file mode 100644 index 00000000000..677188e6242 --- /dev/null +++ b/erpnext/patches/remove_previous_field_property_setter.py @@ -0,0 +1,6 @@ +import webnotes +def execute(): + webnotes.conn.sql("""\ + DELETE FROM `tabProperty Setter` + WHERE property='previous_field' + """) diff --git a/erpnext/patches/update_0_idx.py b/erpnext/patches/update_0_idx.py new file mode 100644 index 00000000000..9c31f1d6641 --- /dev/null +++ b/erpnext/patches/update_0_idx.py @@ -0,0 +1,9 @@ +import webnotes +def execute(): + doc_type_list = webnotes.conn.sql("""SELECT DISTINCT parent FROM `tabDocField` where idx=0""") + for doc_type in doc_type_list: + if doc_type and doc_type[0]: + webnotes.conn.sql("""\ + UPDATE `tabDocField` SET idx=idx+1 + WHERE parent=%s + """, doc_type[0]) diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py index 5b760245e25..3498a7f55f3 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.py +++ b/erpnext/setup/doctype/email_digest/email_digest.py @@ -121,6 +121,8 @@ class DocType: #webnotes.msgprint(query) #webnotes.msgprint(res) result[query] = (res and len(res)==1) and res[0] or (res and res or None) + if result[query] is None: + del result[query] return result @@ -586,7 +588,7 @@ class DocType: }, 'bank_balance': { - 'table': 'bank_balance' in result and table({ + 'table': 'bank_balance' in result and result['bank_balance'] and table({ 'head': 'Bank Balance', 'body': [ [ @@ -662,8 +664,15 @@ class DocType: table_list.append(\ "