Merge pull request #1700 from rmehta/develop
Various UI Bug Fixes
diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py
index bbcd143..0e4ac31 100644
--- a/erpnext/controllers/status_updater.py
+++ b/erpnext/controllers/status_updater.py
@@ -87,7 +87,7 @@
frappe.db.set_value(self.doctype, self.name, "status", self.status)
def on_communication(self):
- if not self.get("communication"): return
+ if not self.get("communications"): return
self.communication_set = True
self.get("communications").sort(key=lambda d: d.creation)
self.set_status(update=True)
diff --git a/erpnext/patches/v4_0/update_account_root_type.py b/erpnext/patches/v4_0/update_account_root_type.py
index a93b835..10f6cda 100644
--- a/erpnext/patches/v4_0/update_account_root_type.py
+++ b/erpnext/patches/v4_0/update_account_root_type.py
@@ -20,15 +20,10 @@
""")
else:
- frappe.db.sql("""UPDATE tabAccount
- SET root_type = CASE
- WHEN name like '%%asset%%' THEN 'Asset'
- WHEN name like '%%liabilities%%' THEN 'Liability'
- WHEN name like '%%expense%%' THEN 'Expense'
- WHEN name like '%%income%%' THEN 'Income'
- END
- WHERE ifnull(parent_account, '') = ''
- """)
+ for key, root_type in (("asset", "Asset"), ("liabilities", "Liability"), ("expense", "Expense"),
+ ("income", "Income")):
+ frappe.db.sql("""update tabAccount set root_type=%s where name like %s
+ and ifnull(parent_account, '')=''""", (root_type, "%" + key + "%"))
for root in frappe.db.sql("""SELECT name, lft, rgt, root_type FROM `tabAccount`
WHERE ifnull(parent_account, '')=''""", as_dict=True):
diff --git a/erpnext/setup/page/setup_wizard/install_fixtures.py b/erpnext/setup/page/setup_wizard/install_fixtures.py
index 2a0a271..90ef1f4 100644
--- a/erpnext/setup/page/setup_wizard/install_fixtures.py
+++ b/erpnext/setup/page/setup_wizard/install_fixtures.py
@@ -71,7 +71,6 @@
# Designation
{'doctype': 'Designation', 'designation_name': _('CEO')},
- {'doctype': 'Designation', 'designation_name': _('Director')},
{'doctype': 'Designation', 'designation_name': _('Manager')},
{'doctype': 'Designation', 'designation_name': _('Analyst')},
{'doctype': 'Designation', 'designation_name': _('Engineer')},