Merge branch 'edge' of github.com:webnotes/erpnext into edge
Conflicts:
patches/january_2013/holiday_list_patch.py
diff --git a/patches/january_2013/holiday_list_patch.py b/patches/january_2013/holiday_list_patch.py
index ec78b16..e8e8f8c 100644
--- a/patches/january_2013/holiday_list_patch.py
+++ b/patches/january_2013/holiday_list_patch.py
@@ -1,10 +1,9 @@
import webnotes
-from collections import Counter
def execute():
for name in webnotes.conn.sql("""select name from `tabHoliday List`"""):
holiday_list_wrapper = webnotes.model_wrapper("Holiday List", name[0])
- desc_count = Counter([d.description for d in
+ desc_count = _count([d.description for d in
holiday_list_wrapper.doclist.get({"doctype": "Holiday"})])
holiday_list_obj = webnotes.get_obj(doc=holiday_list_wrapper.doc,
@@ -29,8 +28,12 @@
holiday_list_wrapper.set_doclist(holiday_list_obj.doclist)
holiday_list_wrapper.save()
-
+def _count(lst):
+ out = {}
+ for l in lst:
+ out[l] = out.setdefault(l, 0) + 1
+ return out