brotherton-erpnext/patches/march_2013/p03_rename_blog_to_blog_post.py
2013-03-11 14:34:05 +05:30

10 lines
415 B
Python

import webnotes
def execute():
webnotes.reload_doc('website', 'doctype', 'blogger')
webnotes.conn.sql('''update tabBlogger set posts=(select count(*)
from tabBlog where ifnull(blogger,"")=tabBlogger.name)''')
webnotes.rename_doc("DocType", "Blog", "Blog Post", force=True)
webnotes.conn.reload_doc('website', 'doctype', 'blog_post')
webnotes.conn.sql("""update `tabBlog Post` set published_on=creation""")